mirror of
https://github.com/oven-sh/bun
synced 2026-02-11 03:18:53 +00:00
* make the shell throw by default * make shell default to throws(true) * ok * mv tests * a * a * [autofix.ci] apply automated fixes --------- Co-authored-by: Jarred Sumner <jarred@jarredsumner.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
19 lines
621 B
TypeScript
19 lines
621 B
TypeScript
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 shell script works", async () => {
|
|
const dir = join(realpathSync(tmpdir()), "bun-run-shell");
|
|
mkdirSync(dir, { recursive: true });
|
|
await Bun.write(join(dir, "something.sh"), "echo wah");
|
|
let { stdout, stderr } = Bun.spawnSync({
|
|
cmd: [bunExe(), join(dir, "something.sh")],
|
|
cwd: dir,
|
|
env: bunEnv,
|
|
});
|
|
console.log(stderr.toString("utf8"));
|
|
expect(stdout.toString("utf8")).toEqual("wah\n");
|
|
});
|