Files
bun.sh/test/cli/run/run_command.test.ts
Jarred Sumner a119e8d636 fs.readFile & fs.writeFile encoding + simplify string handling + fix memory leak (#7797)
* Simplify string handling code

* add extra + external

* Update fs.test.ts

* Bump

* woopsie

* prettier

* Rename stats() to resourceUsage()

* Fix leak

* Fix more leaks

* Setup malloc heap breakdown

* Thread safety

* Fix bug when creating buffer from utf-16 string

cc @dylan-conway

* Use global allocator

* More new

* Update fs.test.ts

* Update setTimeout.test.js

* Fix UAF in HTMLRewriter

* More bun.new

* Remove logs

* Un-skip test which no longer is flaky

* Even more `bun.new`

* Fix memory leak in HTMLRewriter.

Fixes #2325

* Don't accept Buffer for now

* Fix issue with node-fetch polyfill

* Don't destruct the response value too soon

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-12-24 06:10:46 -08:00

21 lines
534 B
TypeScript

import { describe, test, expect } from "bun:test";
import { spawnSync } from "bun";
import { bunEnv, bunExe } from "harness";
let cwd: string;
describe("bun", () => {
test("should error with missing script", () => {
const { exitCode, stdout, stderr } = spawnSync({
cwd,
cmd: [bunExe(), "run", "dev"],
env: bunEnv,
stdout: "pipe",
stderr: "pipe",
});
expect(stdout.toString()).toBeEmpty();
expect(stderr.toString()).toMatch(/Script not found/);
expect(exitCode).toBe(1);
});
});