diff --git a/src/wpt/BUILD.bazel b/src/wpt/BUILD.bazel index 91540e8ce0a..9aace1696f5 100644 --- a/src/wpt/BUILD.bazel +++ b/src/wpt/BUILD.bazel @@ -275,3 +275,9 @@ wpt_test( config = "FileAPI-test.ts", wpt_directory = "@wpt//:FileAPI@module", ) + +wpt_test( + name = "console", + config = "console-test.ts", + wpt_directory = "@wpt//:console@module", +) diff --git a/src/wpt/console-test.ts b/src/wpt/console-test.ts new file mode 100644 index 00000000000..e42f6a4f07d --- /dev/null +++ b/src/wpt/console-test.ts @@ -0,0 +1,34 @@ +// Copyright (c) 2017-2026 Cloudflare, Inc. +// Licensed under the Apache 2.0 license found in the LICENSE file or at: +// https://opensource.org/licenses/Apache-2.0 + +import { type TestRunnerConfig } from 'harness/harness'; + +export default { + 'console-is-a-namespace.any.js': {}, + 'console-label-conversion.any.js': { + comment: + 'count, countReset, time, timeLog and timeEnd come from the V8 builtin console, which does not convert object labels with toString() or rethrow conversion errors', + expectedFailures: [ + "console.count()'s label gets converted to string via label.toString() when label is an object", + 'console.count() throws exceptions generated by erroneous label.toString() conversion', + "console.countReset()'s label gets converted to string via label.toString() when label is an object", + 'console.countReset() throws exceptions generated by erroneous label.toString() conversion', + "console.time()'s label gets converted to string via label.toString() when label is an object", + 'console.time() throws exceptions generated by erroneous label.toString() conversion', + "console.timeLog()'s label gets converted to string via label.toString() when label is an object", + 'console.timeLog() throws exceptions generated by erroneous label.toString() conversion', + "console.timeEnd()'s label gets converted to string via label.toString() when label is an object", + 'console.timeEnd() throws exceptions generated by erroneous label.toString() conversion', + ], + }, + 'console-log-large-array.any.js': {}, + 'console-log-symbol.any.js': {}, + 'console-namespace-object-class-string.any.js': {}, + 'console-tests-historical.any.js': {}, + 'helper.js': { + comment: 'Helper file picked up by discovery, not a test', + omittedTests: true, + }, + 'idlharness.any.js': {}, +} satisfies TestRunnerConfig;