diff options
Diffstat (limited to 'tests/wpt/web-platform-tests/html/semantics/scripting-1/the-script-element/json-module/non-object.any.js')
-rw-r--r-- | tests/wpt/web-platform-tests/html/semantics/scripting-1/the-script-element/json-module/non-object.any.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/wpt/web-platform-tests/html/semantics/scripting-1/the-script-element/json-module/non-object.any.js b/tests/wpt/web-platform-tests/html/semantics/scripting-1/the-script-element/json-module/non-object.any.js new file mode 100644 index 00000000000..398da56595f --- /dev/null +++ b/tests/wpt/web-platform-tests/html/semantics/scripting-1/the-script-element/json-module/non-object.any.js @@ -0,0 +1,14 @@ +// META: global=window,worker + +for (const value of [null, true, false, "string"]) { + promise_test(async t => { + const result = await import(`./${value}.json`); + assert_equals(result, value); + }, `Non-object: ${value}`); +} + +promise_test(async t => { + const result = await import("./array.json"); + assert_array_equals(result, ["en", "try"]); +}, "Non-object: array"); + |