@@ -5,21 +5,21 @@ var vm = require('vm');
5
5
6
6
common . globalCheck = false ;
7
7
8
- console . error ( 'run a string' ) ;
8
+ // Run a string
9
9
var result = vm . runInThisContext ( '\'passed\';' ) ;
10
- assert . equal ( 'passed' , result ) ;
10
+ assert . strictEqual ( 'passed' , result ) ;
11
11
12
- console . error ( ' thrown error' ) ;
12
+ // thrown error
13
13
assert . throws ( function ( ) {
14
14
vm . runInThisContext ( 'throw new Error(\'test\');' ) ;
15
15
} , / t e s t / ) ;
16
16
17
17
global . hello = 5 ;
18
18
vm . runInThisContext ( 'hello = 2' ) ;
19
- assert . equal ( 2 , global . hello ) ;
19
+ assert . strictEqual ( 2 , global . hello ) ;
20
20
21
21
22
- console . error ( ' pass values' ) ;
22
+ // pass values
23
23
var code = 'foo = 1;' +
24
24
'bar = 2;' +
25
25
'if (typeof baz !== \'undefined\') throw new Error(\'test fail\');' ;
@@ -28,11 +28,11 @@ global.obj = { foo: 0, baz: 3 };
28
28
/* eslint-disable no-unused-vars */
29
29
var baz = vm . runInThisContext ( code ) ;
30
30
/* eslint-enable no-unused-vars */
31
- assert . equal ( 0 , global . obj . foo ) ;
32
- assert . equal ( 2 , global . bar ) ;
33
- assert . equal ( 1 , global . foo ) ;
31
+ assert . strictEqual ( 0 , global . obj . foo ) ;
32
+ assert . strictEqual ( 2 , global . bar ) ;
33
+ assert . strictEqual ( 1 , global . foo ) ;
34
34
35
- console . error ( ' call a function' ) ;
35
+ // call a function
36
36
global . f = function ( ) { global . foo = 100 ; } ;
37
37
vm . runInThisContext ( 'f()' ) ;
38
- assert . equal ( 100 , global . foo ) ;
38
+ assert . strictEqual ( 100 , global . foo ) ;
0 commit comments