diff options
Diffstat (limited to '')
-rw-r--r-- | dom/base/test/jsmodules/test_dynamicImportErrorMessage.html | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/dom/base/test/jsmodules/test_dynamicImportErrorMessage.html b/dom/base/test/jsmodules/test_dynamicImportErrorMessage.html new file mode 100644 index 0000000000..f5552d5a6b --- /dev/null +++ b/dom/base/test/jsmodules/test_dynamicImportErrorMessage.html @@ -0,0 +1,16 @@ +<!DOCTYPE html> +<meta charset=utf-8> +<title>Test the error message from import()</title> +<script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script> +<script> + SimpleTest.waitForExplicitFinish(); + + async function testLoaded() { + await import("./404.js").catch((error) => { + ok(error instanceof TypeError, "Should be a TypeError."); + ok(error.message.match(/404.js/), "Should have the filename."); + SimpleTest.finish(); + }); + } +</script> +<body onload='testLoaded()'></body> |