blob: f90724f4f63f65083a0444bec9936ccbaab429a0 [file] [log] [blame]
<!doctype html>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
promise_test(async test => {
const result = await import("./export-hello.js", { assert: { } });
assert_equals(result.default, "hello");
}, "Dynamic import with an empty assert clause should succeed");
promise_test(async test => {
const result = await import("./export-hello.js", { assert: { unsupportedAssertionKey: "unsupportedAssertionValue"} });
assert_equals(result.default, "hello");
}, "Dynamic import with an unsupported import assertion should succeed");
promise_test(test => {
return promise_rejects_js(test, TypeError,
import("./export-hello.js", { assert: { type: "notARealType"} } ),
"Dynamic import with an unsupported type assertion should fail");
}, "Dynamic import with an unsupported type assertion should fail");
</script>