From b3980c76e433f1ff51912108b8b607c04655e014 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Mon, 8 Oct 2018 12:41:56 -0700 Subject: test: rename WPT console test test-console-is-a-namespace.js is a WPT Console test. It is the only WPT Console test file that we have that doesn't start with `test-whatwg-`. Rename it to test-whatwg-console-is-a-namespace.js so that WPT tests can be found relatively easily. Just as it is useful to separate the WPT URL tests from our URL tests, it will likely be useful to separate our Console tests from WPT Console tests if we add more WPT Console tests (which I hope we do). PR-URL: https://github.com/nodejs/node/pull/23340 Reviewed-By: Richard Lau Reviewed-By: Sakthipriyan Vairamani Reviewed-By: Colin Ihrig --- test/parallel/test-console-is-a-namespace.js | 50 ---------------------- .../parallel/test-whatwg-console-is-a-namespace.js | 50 ++++++++++++++++++++++ 2 files changed, 50 insertions(+), 50 deletions(-) delete mode 100644 test/parallel/test-console-is-a-namespace.js create mode 100644 test/parallel/test-whatwg-console-is-a-namespace.js (limited to 'test') diff --git a/test/parallel/test-console-is-a-namespace.js b/test/parallel/test-console-is-a-namespace.js deleted file mode 100644 index 8266541187..0000000000 --- a/test/parallel/test-console-is-a-namespace.js +++ /dev/null @@ -1,50 +0,0 @@ -'use strict'; - -require('../common'); - -const { test, assert_equals, assert_true, assert_false } = - require('../common/wpt'); - -// Assigning to itself should not throw. -global.console = global.console; // eslint-disable-line no-self-assign - -const self = global; - -/* 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 -*/ - -// https://heycam.github.io/webidl/#es-namespaces -// https://console.spec.whatwg.org/#console-namespace - -test(() => { - assert_true(self.hasOwnProperty("console")); -}, "console exists on the global object"); - -test(() => { - const propDesc = Object.getOwnPropertyDescriptor(self, "console"); - assert_equals(propDesc.writable, true, "must be writable"); - assert_equals(propDesc.enumerable, false, "must not be enumerable"); - assert_equals(propDesc.configurable, true, "must be configurable"); - assert_equals(propDesc.value, console, "must have the right value"); -}, "console has the right property descriptors"); - -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); - - // 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"); - -/* eslint-enable */ diff --git a/test/parallel/test-whatwg-console-is-a-namespace.js b/test/parallel/test-whatwg-console-is-a-namespace.js new file mode 100644 index 0000000000..8266541187 --- /dev/null +++ b/test/parallel/test-whatwg-console-is-a-namespace.js @@ -0,0 +1,50 @@ +'use strict'; + +require('../common'); + +const { test, assert_equals, assert_true, assert_false } = + require('../common/wpt'); + +// Assigning to itself should not throw. +global.console = global.console; // eslint-disable-line no-self-assign + +const self = global; + +/* 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 +*/ + +// https://heycam.github.io/webidl/#es-namespaces +// https://console.spec.whatwg.org/#console-namespace + +test(() => { + assert_true(self.hasOwnProperty("console")); +}, "console exists on the global object"); + +test(() => { + const propDesc = Object.getOwnPropertyDescriptor(self, "console"); + assert_equals(propDesc.writable, true, "must be writable"); + assert_equals(propDesc.enumerable, false, "must not be enumerable"); + assert_equals(propDesc.configurable, true, "must be configurable"); + assert_equals(propDesc.value, console, "must have the right value"); +}, "console has the right property descriptors"); + +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); + + // 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"); + +/* eslint-enable */ -- cgit v1.2.3