From 7809f386b03d6f2f570fe41060a7ef6e158f5cdb Mon Sep 17 00:00:00 2001 From: Ruben Bridgewater Date: Wed, 17 Jan 2018 01:00:15 +0100 Subject: test: improve console tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/17708 Reviewed-By: Benjamin Gruenbaum Reviewed-By: James M Snell Reviewed-By: Michaƫl Zasso Reviewed-By: Matteo Collina Reviewed-By: Anatoli Papirovski --- test/parallel/test-console-is-a-namespace.js | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'test/parallel/test-console-is-a-namespace.js') 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 */ -- cgit v1.2.1