aboutsummaryrefslogtreecommitdiff
path: root/test/js/web/abort/abort.test.ts
blob: 4895e0d137fc314d858c297abcd64df02da96b43 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import { describe, test, expect } from "bun:test";
import { bunExe, bunEnv } from "harness";
import { writeFileSync } from "fs";
import { join } from "path";
import { tmpdir } from "os";

describe("AbortSignal", () => {
  test("spawn test", async () => {
    const fileName = `/abort-${Date.now()}.test.ts`;
    const testFileContents = await Bun.file(join(import.meta.dir, "abort.ts")).arrayBuffer();

    writeFileSync(join(tmpdir(), fileName), testFileContents, "utf8");
    const { stderr } = Bun.spawnSync({
      cmd: [bunExe(), "test", fileName],
      env: bunEnv,
      cwd: tmpdir(),
    });

    expect(stderr?.toString()).not.toContain("✗");
  });
});