aboutsummaryrefslogtreecommitdiff
path: root/test/transpiler/template-literal.test.ts
blob: a0fd2170f32ae565e29066f0e724684f0198b66a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import { test, expect } from "bun:test";
import { bunEnv, bunExe } from "harness";
import { join } from "path";

// When targeting Bun's runtime,
// We must escape latin1 characters in raw template literals
// This is somewhat brittle
test("template literal", () => {
  const { stdout, exitCode } = Bun.spawnSync({
    cmd: [bunExe(), "run", join(import.meta.dir, "template-literal-fixture-test.js")],
    env: bunEnv,
    stdout: "pipe",
    stderr: "inherit",
  });

  expect(exitCode).toBe(0);
  expect(stdout.toString()).toBe(
    // This is base64 encoded contents of the template literal
    // this narrows down the test to the transpiler instead of the runtime
    "8J+QsDEyMzEyM/CfkLDwn5Cw8J+QsPCfkLDwn5Cw8J+QsDEyM/CfkLAxMjPwn5CwMTIzMTIz8J+QsDEyM/CfkLAxMjPwn5CwLPCfkLB0cnVl",
  );
});
.zig?h=dylan/github-api-option&id=8effa394100b26805cc9ca298659f1a5a7c3dda9&follow=1'>[bun.js] Add `ShadowRealm`Gravatar Jarred Sumner 7-18/+70 2022-02-24[bun-framework-next] Remove TextEncoder & TextDecoder polyfillsGravatar Jarred Sumner 3-340/+19 2022-02-24Use a JSFinalobject for PathGravatar Jarred Sumner 2-81/+42 2022-02-24Expose TextEncoder & TextDecoder globallyGravatar Jarred Sumner 3-20/+750 2022-02-24[Web Platform] Implement TextEncoder & TextDecoderGravatar Jarred Sumner 12-358/+1044 2022-02-24move GCDeferralContextGravatar Jarred Sumner 2-18/+24 2022-02-24[JS Parser] ensure assertions are never run at runtimeGravatar Jarred Sumner 1-13/+18 2022-02-24misc cleanupGravatar Jarred Sumner 2-7/+18 2022-02-22Make format consistent with WebKitGravatar Jarred Sumner 20-3596/+4110 2022-02-22import assertion testGravatar Jarred Sumner 1-0/+33 2022-02-22snaspshotsGravatar Jarred Sumner 42-94/+113