aboutsummaryrefslogtreecommitdiff
path: root/test/bun.js/non-english-import.test.ts
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2022-11-30 05:49:01 -0800
committerGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2022-11-30 05:49:01 -0800
commit6213a91f058cc461fb916d479f03f602c552c377 (patch)
tree5442b8e30a1eebfda378586913dd56a27bd3ba88 /test/bun.js/non-english-import.test.ts
parentf999bdca26256b7ad42d93268c34362b251330c2 (diff)
downloadbun-jarred/make-strings-better.tar.gz
bun-jarred/make-strings-better.tar.zst
bun-jarred/make-strings-better.zip
[wip internal] Introduce `bun.String` which wraps `WTF::String` and allows us to reuse themjarred/make-strings-better
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);
+ }
+});