Skip to content

Commit c672a2a

Browse files
test: fix CLI test for empty output file (#20640)
* test: Add comprehensive tests for the CLI module, covering flag calculation, execution scenarios, and formatter behavior. * fix: use --no-ignore and --no-warn-ignored to fix empty output test on CI * Update tests/lib/cli.js Co-authored-by: Francesco Trotta <github@fasttime.org> * fix: use relative path for fixture file in empty output test --------- Co-authored-by: Francesco Trotta <github@fasttime.org>
1 parent b7b57fe commit c672a2a

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

tests/lib/cli.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1077,11 +1077,10 @@ describe("cli", () => {
10771077

10781078
// https://github.com/eslint/eslint/issues/17660
10791079
it(`should write the file and create dirs if they don't exist even when output is empty`, async () => {
1080-
const filePath = getFixturePath("single-quoted.js");
1080+
const filePath = "tests/fixtures/single-quoted.js";
10811081
const code = `--no-config-lookup --rule 'quotes: [1, single]' --o tests/output/eslint-output.txt ${filePath}`;
10821082

1083-
// TODO: fix this test to: await cli.execute(code);
1084-
await cli.execute(code, "var a = 'b'");
1083+
await cli.execute(code);
10851084

10861085
assert.isTrue(fs.existsSync("tests/output/eslint-output.txt"));
10871086
assert.strictEqual(

0 commit comments

Comments
 (0)