summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/service-workers/service-worker/resources/no-dynamic-import.js
blob: ecedd6c5d75c7d667543a2cbd2ea849194d31bc8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/** @type {[name: string, url: string][]} */
const importUrlTests = [
  ["Module URL", "./basic-module.js"],
  // In no-dynamic-import-in-module.any.js, this module is also statically imported
  ["Another module URL", "./basic-module-2.js"],
  [
    "Module data: URL",
    "data:text/javascript;charset=utf-8," +
      encodeURIComponent(`export default 'hello!';`),
  ],
];

for (const [name, url] of importUrlTests) {
  promise_test(
    (t) => promise_rejects_js(t, TypeError, import(url), "Import must reject"),
    name
  );
}