aboutsummaryrefslogtreecommitdiff
path: root/test/bun.js/non-english-import.test.ts
blob: c311a8caf3d9dd0e82a27062bb1e30bdecd8ca3b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import { expect, test } from "bun:test";

test("non-english import works (utf16)", async () => {
  {
    const { default: value } = await import("./not-english-食物.js");
    expect(value).toBe(42);
  }
  {
    const dynamic = "./not-english-食物.js";
    const { default: value } = await import(dynamic);
    expect(value).toBe(42);
  }
});

test("non-english import works (latin1)", async () => {
  {
    const { default: value } = await import("./not-english-àⒸ.js");
    expect(value).toBe(42);
  }

  {
    const dynamic = "./not-english-àⒸ.js";
    const { default: value } = await import(dynamic);
    expect(value).toBe(42);
  }
});