Skip to content

Commit ac58a9a

Browse files
committed
Add test for recommended config
1 parent 8f7ed93 commit ac58a9a

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

tests/index.test.js

+11-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
1-
const { rules } = require('../lib/index');
1+
const { rules, configs } = require('../lib/index');
22

33
it('should have all the rules', () => {
44
expect(rules).toMatchSnapshot();
55
});
6+
7+
it('should have a recommended config with recommended rules', () => {
8+
for (const [name, rule] of Object.entries(rules)) {
9+
if (rule.meta.docs.recommended) {
10+
expect(configs.recommended.rules).toHaveProperty(name, 'error');
11+
} else {
12+
expect(configs.recommended.rules).not.toHaveProperty(name);
13+
}
14+
}
15+
});

0 commit comments

Comments
 (0)