Files
bun.sh/test/regression/issue/07261.test.ts
2024-09-03 21:32:52 -07:00

24 lines
777 B
TypeScript

import { expect, it } from "bun:test";
import { mkdirSync, rmSync, writeFileSync } from "fs";
import { bunEnv, bunExe, tmpdirSync } from "harness";
import { join } from "path";
it("imports tsconfig.json with abritary keys", async () => {
const testDir = tmpdirSync();
// Clean up from prior runs if necessary
rmSync(testDir, { recursive: true, force: true });
// Create a directory with our test tsconfig.json
mkdirSync(testDir, { recursive: true });
writeFileSync(join(testDir, "tsconfig.json"), '{ "key-with-hyphen": true }');
const { exitCode } = Bun.spawnSync({
cmd: [bunExe(), "-e", `require('${join(testDir, "tsconfig.json").replace(/\\/g, "\\\\")}').compilerOptions`],
env: bunEnv,
stderr: "inherit",
});
expect(exitCode).toBe(0);
});