summaryrefslogtreecommitdiff
path: root/cli/tests/013_dynamic_import.ts
blob: 6bbce31328758fcfa105978f8e0703f14a413f61 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
(async (): Promise<void> => {
  const { returnsHi, returnsFoo2, printHello3 } = await import(
    "./subdir/mod1.ts"
  );

  printHello3();

  if (returnsHi() !== "Hi") {
    throw Error("Unexpected");
  }

  if (returnsFoo2() !== "Foo") {
    throw Error("Unexpected");
  }
})();