diff options
author | Ruben Bridgewater <ruben@bridgewater.de> | 2018-01-17 01:00:15 +0100 |
---|---|---|
committer | Ruben Bridgewater <ruben@bridgewater.de> | 2018-01-18 18:12:25 +0100 |
commit | 7809f386b03d6f2f570fe41060a7ef6e158f5cdb (patch) | |
tree | 716e77e4a87eef9c21b9fa149982c4786f8f34d4 /test/parallel/test-console-is-a-namespace.js | |
parent | 6ff52b69cc6b3fd05aa332623cbc49c5d3eb7ece (diff) | |
download | node-new-7809f386b03d6f2f570fe41060a7ef6e158f5cdb.tar.gz |
test: improve console tests
PR-URL: https://github.com/nodejs/node/pull/17708
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michaƫl Zasso <targos@protonmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Diffstat (limited to 'test/parallel/test-console-is-a-namespace.js')
-rw-r--r-- | test/parallel/test-console-is-a-namespace.js | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/test/parallel/test-console-is-a-namespace.js b/test/parallel/test-console-is-a-namespace.js index f413000805..617e334a83 100644 --- a/test/parallel/test-console-is-a-namespace.js +++ b/test/parallel/test-console-is-a-namespace.js @@ -12,8 +12,9 @@ assert.doesNotThrow(() => { const self = global; -/* eslint-disable */ -/* The following tests are copied from */ +/* eslint-disable quotes, max-len */ + +/* The following tests should not be modified as they are copied */ /* WPT Refs: https://github.com/w3c/web-platform-tests/blob/40e451c/console/console-is-a-namespace.any.js License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html @@ -38,12 +39,14 @@ test(() => { assert_false("Console" in self); }, "Console (uppercase, as if it were an interface) must not exist"); +test(() => { + const prototype1 = Object.getPrototypeOf(console); + const prototype2 = Object.getPrototypeOf(prototype1); -// test(() => { -// const prototype1 = Object.getPrototypeOf(console); -// const prototype2 = Object.getPrototypeOf(prototype1); + // This got commented out from the original test because in Node.js all + // functions are declared on the prototype. + // assert_equals(Object.getOwnPropertyNames(prototype1).length, 0, "The [[Prototype]] must have no properties"); + assert_equals(prototype2, Object.prototype, "The [[Prototype]]'s [[Prototype]] must be %ObjectPrototype%"); +}, "The prototype chain must be correct"); -// assert_equals(Object.getOwnPropertyNames(prototype1).length, 0, "The [[Prototype]] must have no properties"); -// assert_equals(prototype2, Object.prototype, "The [[Prototype]]'s [[Prototype]] must be %ObjectPrototype%"); -// }, "The prototype chain must be correct"); /* eslint-enable */ |