1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-15 03:48:02 -05:00
denoland-deno/cli/tests/testdata/compile/dynamic_imports/main_unanalyzable.ts
Matt Mastracci db9482d688
chore: Use relative paths for assert imports to avoid test flakes (#19427)
Tests occasionally fail if we get a bad gateway attempting to fetch the
assertion module
2023-06-08 18:10:37 +00:00

18 lines
686 B
TypeScript

import { join } from "../../../../../test_util/std/path/mod.ts";
console.log("Starting the main module");
// We load the dynamic import path from the file system, to make sure any
// improvements in static analysis can't defeat the purpose of this test, which
// is to make sure the `--include` flag works to add non-analyzed imports to the
// module graph.
const IMPORT_PATH_FILE_PATH = join(
Deno.cwd(),
"tests/testdata/compile/dynamic_imports/import_path",
);
setTimeout(async () => {
console.log("Dynamic importing");
const importPath = (await Deno.readTextFile(IMPORT_PATH_FILE_PATH)).trim();
import(importPath).then(() => console.log("Dynamic import done."));
}, 0);