File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
test/js-native-api/test_symbol Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -6,10 +6,13 @@ const assert = require('assert');
6
6
const test_symbol = require ( `./build/${ common . buildType } /test_symbol` ) ;
7
7
8
8
const fooSym = test_symbol . New ( 'foo' ) ;
9
+ assert . strictEqual ( fooSym . toString ( ) , 'Symbol(foo)' ) ;
10
+
9
11
const myObj = { } ;
10
12
myObj . foo = 'bar' ;
11
13
myObj [ fooSym ] = 'baz' ;
12
- Object . keys ( myObj ) ; // -> [ 'foo' ]
13
- Object . getOwnPropertyNames ( myObj ) ; // -> [ 'foo' ]
14
- Object . getOwnPropertySymbols ( myObj ) ; // -> [ Symbol(foo) ]
14
+
15
+ assert . deepStrictEqual ( Object . keys ( myObj ) , [ 'foo' ] ) ;
16
+ assert . deepStrictEqual ( Object . getOwnPropertyNames ( myObj ) , [ 'foo' ] ) ;
17
+ assert . strictEqual ( Object . getOwnPropertySymbols ( myObj ) . length , 1 ) ;
15
18
assert . strictEqual ( Object . getOwnPropertySymbols ( myObj ) [ 0 ] , fooSym ) ;
You can’t perform that action at this time.
0 commit comments