summaryrefslogtreecommitdiff
path: root/js/console_test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'js/console_test.ts')
-rw-r--r--js/console_test.ts12
1 files changed, 11 insertions, 1 deletions
diff --git a/js/console_test.ts b/js/console_test.ts
index 39ccad843..ed2f37548 100644
--- a/js/console_test.ts
+++ b/js/console_test.ts
@@ -10,6 +10,16 @@ function stringify(...args: unknown[]): string {
return stringifyArgs(args).replace(/\n$/, "");
}
+// test cases from web-platform-tests
+// via https://github.com/web-platform-tests/wpt/blob/master/console/console-is-a-namespace.any.js
+test(function consoleShouldBeANamespace() {
+ const prototype1 = Object.getPrototypeOf(console);
+ const prototype2 = Object.getPrototypeOf(prototype1);
+
+ assertEquals(Object.getOwnPropertyNames(prototype1).length, 0);
+ assertEquals(prototype2, Object.prototype);
+});
+
test(function consoleTestAssertShouldNotThrowError() {
console.assert(true);
@@ -123,7 +133,7 @@ test(function consoleTestStringifyCircular() {
assertEquals(stringify(JSON), "{}");
assertEquals(
stringify(console),
- "Console { printFunc, log, debug, info, dir, warn, error, assert, count, countReset, table, time, timeLog, timeEnd, group, groupCollapsed, groupEnd, clear, indentLevel, collapsedAt }"
+ "{ printFunc, log, debug, info, dir, warn, error, assert, count, countReset, table, time, timeLog, timeEnd, group, groupCollapsed, groupEnd, clear, indentLevel, collapsedAt }"
);
// test inspect is working the same
assertEquals(inspect(nestedObj), nestedObjExpected);