File tree Expand file tree Collapse file tree 2 files changed +8
-10
lines changed
Expand file tree Collapse file tree 2 files changed +8
-10
lines changed Original file line number Diff line number Diff line change 2020 "istanbul" : " latest" ,
2121 "jshint" : " latest" ,
2222 "uglify-js" : " latest" ,
23- "coveralls" : " latest" ,
24- "contextify" : " latest"
23+ "coveralls" : " latest"
2524 },
2625 "scripts" : {
2726 "test" : " node ./node_modules/.bin/_mocha --reporter spec" ,
Original file line number Diff line number Diff line change 11var validator = require ( '../validator' )
22 , format = require ( 'util' ) . format
3- , contextify = require ( 'contextify' )
43 , assert = require ( 'assert' )
54 , path = require ( 'path' )
6- , fs = require ( 'fs' ) ;
5+ , fs = require ( 'fs' )
6+ , vm = require ( 'vm' ) ;
77
88var validator_js = fs . readFileSync ( path . join ( __dirname , '../validator.js' ) ) . toString ( ) ;
99
@@ -1187,17 +1187,16 @@ describe('Validators', function () {
11871187 }
11881188 } ;
11891189 window . define . amd = true ;
1190- var sandbox = contextify ( window ) ;
1191- sandbox . run ( validator_js ) ;
1192- sandbox . dispose ( ) ;
1190+
1191+ var sandbox = vm . createContext ( window ) ;
1192+ vm . runInContext ( validator_js , sandbox ) ;
11931193 assert . equal ( window . validator . trim ( ' foobar ' ) , 'foobar' ) ;
11941194 } ) ;
11951195
11961196 it ( 'should bind validator to the window if no module loaders are available' , function ( ) {
11971197 var window = { } ;
1198- var sandbox = contextify ( window ) ;
1199- sandbox . run ( validator_js ) ;
1200- sandbox . dispose ( ) ;
1198+ var sandbox = vm . createContext ( window ) ;
1199+ vm . runInContext ( validator_js , sandbox ) ;
12011200 assert . equal ( window . validator . trim ( ' foobar ' ) , 'foobar' ) ;
12021201 } ) ;
12031202
You can’t perform that action at this time.
0 commit comments