Skip to content

Commit 6178167

Browse files
committed
chore: add tests for flat configs
1 parent 2ef1ac3 commit 6178167

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

tests/lib/configs/flat.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
"use strict"
2+
3+
const assert = require("assert")
4+
const pkg = require("eslint-plugin-n")
5+
6+
describe("flat configs", () => {
7+
it("should correctly export the plugin", () => {
8+
assert.strictEqual(typeof pkg, "object")
9+
assert.strictEqual(pkg.meta.name, "eslint-plugin-n")
10+
assert(pkg.configs)
11+
assert(pkg.rules)
12+
})
13+
14+
it("should export flat/recommended-module", () => {
15+
const config = pkg.configs["flat/recommended-module"]
16+
assert.strictEqual(config.plugins.n, pkg)
17+
assert(config.rules, "should have rules configured")
18+
})
19+
20+
it("should export flat/recommeded-script", () => {
21+
const config = pkg.configs["flat/recommended-script"]
22+
assert.strictEqual(config.plugins.n, pkg)
23+
assert(config.rules, "should have rules configured")
24+
})
25+
26+
it("should export flat/all", () => {
27+
const config = pkg.configs["flat/all"]
28+
assert.strictEqual(config.plugins.n, pkg)
29+
assert(config.rules, "should have rules configured")
30+
})
31+
})

0 commit comments

Comments
 (0)