diff --git a/.travis.yml b/.travis.yml index 0e0c04a9b..d7e6f3466 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ sudo: false language: node_js node_js: - - "0.10" - - "0.12" + - "4.0" + - "4.1" after_script: - npm run coveralls diff --git a/README.md b/README.md index 771a5fca1..2cc70939b 100644 --- a/README.md +++ b/README.md @@ -128,6 +128,8 @@ validator.isWhitespace('foo bar'); ### Tests +Tests require node v4.0+. + - `make test` - run the test suite. - `make test V=1` - run the test suite with added verbosity. - `make test TEST=pattern` - run tests that match a pattern. diff --git a/package.json b/package.json index c538ec16e..d72dcc5cf 100644 --- a/package.json +++ b/package.json @@ -20,8 +20,7 @@ "istanbul": "latest", "jshint": "latest", "uglify-js": "latest", - "coveralls": "latest", - "contextify": "latest" + "coveralls": "latest" }, "scripts": { "test": "node ./node_modules/.bin/_mocha --reporter spec", diff --git a/test/validators.js b/test/validators.js index 959ba1dbd..1f99f33b1 100644 --- a/test/validators.js +++ b/test/validators.js @@ -1,9 +1,9 @@ var validator = require('../validator') , format = require('util').format - , contextify = require('contextify') , assert = require('assert') , path = require('path') - , fs = require('fs'); + , fs = require('fs') + , vm = require('vm'); var validator_js = fs.readFileSync(path.join(__dirname, '../validator.js')).toString(); @@ -1187,17 +1187,16 @@ describe('Validators', function () { } }; window.define.amd = true; - var sandbox = contextify(window); - sandbox.run(validator_js); - sandbox.dispose(); + + var sandbox = vm.createContext(window); + vm.runInContext(validator_js, sandbox); assert.equal(window.validator.trim(' foobar '), 'foobar'); }); it('should bind validator to the window if no module loaders are available', function () { var window = {}; - var sandbox = contextify(window); - sandbox.run(validator_js); - sandbox.dispose(); + var sandbox = vm.createContext(window); + vm.runInContext(validator_js, sandbox); assert.equal(window.validator.trim(' foobar '), 'foobar'); });