mirror of
https://github.com/oven-sh/bun
synced 2026-02-16 05:42:43 +00:00
test case for utf-16 change
This commit is contained in:
@@ -12,7 +12,8 @@
|
||||
/// Version 13: Hoist `import.meta.require` definition, see #15738
|
||||
/// Version 14: Updated global defines table list.
|
||||
/// Version 15: Updated global defines table list.
|
||||
const expected_version = 15;
|
||||
/// Version 16: Emojis in strings are preserved in unicode output (node/web)
|
||||
const expected_version = 16;
|
||||
|
||||
const debug = Output.scoped(.cache, false);
|
||||
const MINIMUM_CACHE_SIZE = 50 * 1024;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { describe } from "bun:test";
|
||||
import { describe, expect } from "bun:test";
|
||||
import { dedent, itBundled } from "./expectBundled";
|
||||
|
||||
interface TemplateStringTest {
|
||||
@@ -89,6 +89,20 @@ const templateStringTests: Record<string, TemplateStringTest> = {
|
||||
};
|
||||
|
||||
describe("bundler", () => {
|
||||
// Test for emoji output in bun build
|
||||
itBundled("string/EmojiDirectOutput", {
|
||||
files: {
|
||||
"a.js": `console.log("😀");`,
|
||||
},
|
||||
outfile: "out.js",
|
||||
onAfterBundle(api) {
|
||||
const content = api.readFile("out.js");
|
||||
expect(content).toContain("😀");
|
||||
expect(content).not.toContain("\\ud83d");
|
||||
expect(content).not.toContain("\\ude00");
|
||||
},
|
||||
});
|
||||
|
||||
for (const key in templateStringTests) {
|
||||
const test = templateStringTests[key];
|
||||
if ([test.capture, test.captureRaw, test.print].filter(x => x !== undefined).length !== 1) {
|
||||
|
||||
Reference in New Issue
Block a user