summaryrefslogtreecommitdiffstats
path: root/dom/base/test/jsmodules/test_dynamicImportErrorMessage.html
blob: f5552d5a6b40370d3a483735b83d7934106fc783 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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>