aboutsummaryrefslogtreecommitdiff
path: root/test/bun.js/esbuild-child_process.test.ts
blob: d64786602173b262facf0ee6e64ef357093fb075 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import { spawnSync } from "bun";
import { describe, it, expect, test } from "bun:test";
import { bunExe } from "bunExe";

test("esbuild", () => {
  const { exitCode, stderr, stdout } = spawnSync(
    [bunExe(), import.meta.dir + "/esbuild-test.js"],
    {
      env: {
        BUN_DEBUG_QUIET_LOGS: "1",
      },
    },
  );
  const out = "" + stderr?.toString() + stdout?.toString();
  if (exitCode !== 0 && out?.length) {
    throw new Error(out);
  }

  expect(exitCode).toBe(0);
});