Skip to content

Commit 2983787

Browse files
committed
fix(test): clear FORCE_COLOR in isTTY fallback tests
Add FORCE_COLOR: undefined to withEnv calls in isTTY fallback tests so they work correctly in CI environments where FORCE_COLOR=1 is set.
1 parent 968b65f commit 2983787

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

test/lib/formatters/markdown.test.ts

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -232,10 +232,14 @@ describe("isPlainOutput", () => {
232232
});
233233
});
234234

235-
describe("isTTY fallback (both env vars unset)", () => {
235+
describe("isTTY fallback (all env vars unset)", () => {
236236
test("non-TTY → plain", () => {
237237
withEnv(
238-
{ SENTRY_PLAIN_OUTPUT: undefined, NO_COLOR: undefined },
238+
{
239+
SENTRY_PLAIN_OUTPUT: undefined,
240+
NO_COLOR: undefined,
241+
FORCE_COLOR: undefined,
242+
},
239243
false,
240244
() => {
241245
expect(isPlainOutput()).toBe(true);
@@ -245,7 +249,11 @@ describe("isPlainOutput", () => {
245249

246250
test("TTY → rendered", () => {
247251
withEnv(
248-
{ SENTRY_PLAIN_OUTPUT: undefined, NO_COLOR: undefined },
252+
{
253+
SENTRY_PLAIN_OUTPUT: undefined,
254+
NO_COLOR: undefined,
255+
FORCE_COLOR: undefined,
256+
},
249257
true,
250258
() => {
251259
expect(isPlainOutput()).toBe(false);
@@ -255,7 +263,11 @@ describe("isPlainOutput", () => {
255263

256264
test("isTTY=undefined → plain", () => {
257265
withEnv(
258-
{ SENTRY_PLAIN_OUTPUT: undefined, NO_COLOR: undefined },
266+
{
267+
SENTRY_PLAIN_OUTPUT: undefined,
268+
NO_COLOR: undefined,
269+
FORCE_COLOR: undefined,
270+
},
259271
undefined,
260272
() => {
261273
expect(isPlainOutput()).toBe(true);

0 commit comments

Comments
 (0)