aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/bun.js/bunEnv.ts6
-rw-r--r--test/bun.js/install/bun-install.test.ts8
-rw-r--r--test/bun.js/log-test.test.ts9
3 files changed, 11 insertions, 12 deletions
diff --git a/test/bun.js/bunEnv.ts b/test/bun.js/bunEnv.ts
new file mode 100644
index 000000000..2fe33a4ea
--- /dev/null
+++ b/test/bun.js/bunEnv.ts
@@ -0,0 +1,6 @@
+export const bunEnv: any = {
+ ...process.env,
+ BUN_DEBUG_QUIET_LOGS: "1",
+ NO_COLOR: "1",
+ FORCE_COLOR: undefined,
+};
diff --git a/test/bun.js/install/bun-install.test.ts b/test/bun.js/install/bun-install.test.ts
index a48b63579..8de41fbc8 100644
--- a/test/bun.js/install/bun-install.test.ts
+++ b/test/bun.js/install/bun-install.test.ts
@@ -11,6 +11,7 @@ import { bunExe } from "bunExe";
import { mkdir, mkdtemp, readdir, readlink, rm, writeFile } from "fs/promises";
import { join } from "path";
import { tmpdir } from "os";
+import { bunEnv } from "bunEnv";
let handler, package_dir, requested, server;
@@ -20,12 +21,7 @@ function resetHanlder() {
};
}
-const env: any = {
- ...process.env,
- BUN_DEBUG_QUIET_LOGS: "1",
- NO_COLOR: "1",
- FORCE_COLOR: undefined,
-};
+const env = bunEnv;
beforeAll(() => {
server = Bun.serve({
diff --git a/test/bun.js/log-test.test.ts b/test/bun.js/log-test.test.ts
index 62098d97c..29f541e32 100644
--- a/test/bun.js/log-test.test.ts
+++ b/test/bun.js/log-test.test.ts
@@ -3,6 +3,7 @@ import { basename, dirname, join } from "path";
import * as fs from "fs";
import { readableStreamToText, spawnSync } from "bun";
import { bunExe } from "bunExe";
+import { bunEnv } from "bunEnv";
it("should not log .env when quiet", async () => {
writeDirectoryTree("/tmp/log-test-silent", {
@@ -13,9 +14,7 @@ it("should not log .env when quiet", async () => {
const { stderr } = spawnSync({
cmd: [bunExe(), "index.ts"],
cwd: "/tmp/log-test-silent",
- env: {
- BUN_DEBUG_QUIET_LOGS: "1",
- },
+ env: bunEnv,
});
expect(stderr!.toString()).toBe("");
@@ -31,9 +30,7 @@ it("should log .env by default", async () => {
const { stderr } = spawnSync({
cmd: [bunExe(), "index.ts"],
cwd: "/tmp/log-test-silent",
- env: {
- BUN_DEBUG_QUIET_LOGS: "1",
- },
+ env: bunEnv,
});
expect(stderr?.toString().includes(".env")).toBe(true);