From ef4c115cc802d7b5f9e04a12c680d8c91a78aa05 Mon Sep 17 00:00:00 2001 From: Darshan Sen Date: Sat, 29 Jan 2022 15:31:10 +0530 Subject: [PATCH] test: replace commented out expectations with tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Darshan Sen PR-URL: https://github.com/nodejs/node/pull/41667 Reviewed-By: Mestery Reviewed-By: Rich Trott Reviewed-By: Luigi Pinca Reviewed-By: Tobias Nießen Reviewed-By: James M Snell --- test/js-native-api/test_symbol/test2.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/test/js-native-api/test_symbol/test2.js b/test/js-native-api/test_symbol/test2.js index 2060409b9bf8df..642d3623cc51fc 100644 --- a/test/js-native-api/test_symbol/test2.js +++ b/test/js-native-api/test_symbol/test2.js @@ -6,10 +6,12 @@ const assert = require('assert'); const test_symbol = require(`./build/${common.buildType}/test_symbol`); const fooSym = test_symbol.New('foo'); +assert.strictEqual(fooSym.toString(), 'Symbol(foo)'); + const myObj = {}; myObj.foo = 'bar'; myObj[fooSym] = 'baz'; -Object.keys(myObj); // -> [ 'foo' ] -Object.getOwnPropertyNames(myObj); // -> [ 'foo' ] -Object.getOwnPropertySymbols(myObj); // -> [ Symbol(foo) ] -assert.strictEqual(Object.getOwnPropertySymbols(myObj)[0], fooSym); + +assert.deepStrictEqual(Object.keys(myObj), ['foo']); +assert.deepStrictEqual(Object.getOwnPropertyNames(myObj), ['foo']); +assert.deepStrictEqual(Object.getOwnPropertySymbols(myObj), [fooSym]);