mirror of
https://github.com/oven-sh/bun
synced 2026-02-02 15:08:46 +00:00
24 lines
777 B
TypeScript
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);
|
|
});
|