mirror of
https://github.com/millionco/react-doctor.git
synced 2026-09-14 20:00:24 +08:00
50999f4a09
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
19 lines
801 B
TypeScript
19 lines
801 B
TypeScript
import { describe, expect, it } from "vite-plus/test";
|
|
import { isDebugFlagEnabled } from "../src/cli/utils/is-debug-flag.js";
|
|
|
|
describe("isDebugFlagEnabled", () => {
|
|
it("is true when --debug appears anywhere in argv", () => {
|
|
expect(isDebugFlagEnabled(["node", "react-doctor", ".", "--debug"])).toBe(true);
|
|
expect(isDebugFlagEnabled(["node", "react-doctor", "--debug", "--json"])).toBe(true);
|
|
});
|
|
|
|
it("is false when --debug is absent", () => {
|
|
expect(isDebugFlagEnabled(["node", "react-doctor", "."])).toBe(false);
|
|
expect(isDebugFlagEnabled(["node", "react-doctor", "--verbose"])).toBe(false);
|
|
});
|
|
|
|
it("does not match a value that merely contains the word debug", () => {
|
|
expect(isDebugFlagEnabled(["node", "react-doctor", "--project", "debug"])).toBe(false);
|
|
});
|
|
});
|