aboutsummaryrefslogtreecommitdiff
path: root/test/bun.js/non-english-import.test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'test/bun.js/non-english-import.test.ts')
-rw-r--r--test/bun.js/non-english-import.test.ts26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/bun.js/non-english-import.test.ts b/test/bun.js/non-english-import.test.ts
new file mode 100644
index 000000000..c311a8caf
--- /dev/null
+++ b/test/bun.js/non-english-import.test.ts
@@ -0,0 +1,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);
+ }
+});