Skip to content

Commit 2dc0061

Browse files
committed
test: add test for unmatched flat config case
1 parent b03296c commit 2dc0061

3 files changed

Lines changed: 11 additions & 0 deletions

File tree

test/cli.test.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
"use strict";
22

3+
const childProcess = require("child_process");
4+
const path = require("path");
35
const cli = require("../bin/cli");
46

57
const offPatterns = [0, "off", [0], ["off"], ["off", "never"]];
@@ -76,6 +78,14 @@ test("no results", () => {
7678
`);
7779
});
7880

81+
test("empty config", (done) => {
82+
childProcess.exec(
83+
`node ${path.join(process.cwd(), "bin/cli.js")} index.js`,
84+
{ cwd: path.join(__dirname, "fixtures/empty-config") },
85+
done
86+
);
87+
});
88+
7989
test("conflicting options", () => {
8090
const rules = ["strict", ["curly", "multi-line"]];
8191
expect(cli.processRules(createRules(rules, "error"))).toMatchInlineSnapshot(`
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export default [{}];

test/fixtures/empty-config/index.js

Whitespace-only changes.

0 commit comments

Comments
 (0)