Skip to content

Commit 1a20417

Browse files
committed
test: replace commented out expectations with tests
Signed-off-by: Darshan Sen <[email protected]>
1 parent b2edcfe commit 1a20417

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

test/js-native-api/test_symbol/test2.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,13 @@ const assert = require('assert');
66
const test_symbol = require(`./build/${common.buildType}/test_symbol`);
77

88
const fooSym = test_symbol.New('foo');
9+
assert.strictEqual(fooSym.toString(), 'Symbol(foo)');
10+
911
const myObj = {};
1012
myObj.foo = 'bar';
1113
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);
1518
assert.strictEqual(Object.getOwnPropertySymbols(myObj)[0], fooSym);

0 commit comments

Comments
 (0)