Files
bun.sh/test/cli/run/run-unicode.test.ts
Dylan Conway 5934b17f00 fix(windows): fix a few more tests (#8644)
* fix regression tests

* fix fs.test.ts bigintstats

* enable transpiler cache lol

* remove failing

* fix filesystem router

* update

* fix run-unicode test

* update comment

* add updated snapshot

* fix remaining node-module-module tests

* fixup

* [autofix.ci] apply automated fixes

* fix tty tests

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-02-02 18:58:16 -08:00

22 lines
816 B
TypeScript
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { expect, test } from "bun:test";
import { mkdirSync, realpathSync } from "fs";
import { bunEnv, bunExe } from "harness";
import { tmpdir } from "os";
import { join } from "path";
test("running a weird filename works", async () => {
const troll = process.platform == "win32" ? "💥'\\" : "💥'\"\n";
const dir = join(realpathSync(tmpdir()), "bun-run-test" + troll);
mkdirSync(dir, { recursive: true });
console.log("dir", dir);
// i this it's possible that the filesystem rejects the path
await Bun.write(join(dir, troll + ".js"), "console.log('hello world');");
let { stdout } = Bun.spawnSync({
cmd: [bunExe(), join(dir, troll + ".js")],
cwd: dir,
env: bunEnv,
stdio: ["ignore", "pipe", "inherit"],
});
expect(stdout.toString("utf8")).toEqual("hello world\n");
});