Skip to content

Commit 766b5a6

Browse files
committed
Test fixes
1 parent 767fa8d commit 766b5a6

File tree

2 files changed

+20
-12
lines changed

2 files changed

+20
-12
lines changed

readme.md

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -153,15 +153,10 @@ See the [ESLint docs](http://eslint.org/docs/user-guide/configuring#extending-co
153153
## Maintainers
154154

155155
- [Sindre Sorhus](https://github.com/sindresorhus)
156-
- [Sam Verschueren](https://github.com/SamVerschueren)
157-
- [futpib](https://github.com/futpib)
158156
- [Adam Babcock](https://github.com/MrHen)
157+
- [futpib](https://github.com/futpib)
158+
- [Sam Verschueren](https://github.com/SamVerschueren)
159159

160160
###### Former
161161

162162
- [Jeroen Engels](https://github.com/jfmengels)
163-
164-
165-
## License
166-
167-
MIT

test/package.js

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,12 @@ test.before(async () => {
1111
ruleFiles = files.filter(file => path.extname(file) === '.js');
1212
});
1313

14+
const ignoredRules = [
15+
'no-nested-ternary'
16+
];
17+
1418
const testSorted = (t, actualOrder, sourceName) => {
19+
actualOrder = actualOrder.filter(x => !ignoredRules.includes(x));
1520
const sortedOrder = actualOrder.slice(0).sort();
1621

1722
for (const [wantedIndex, name] of sortedOrder.entries()) {
@@ -30,10 +35,18 @@ test('Every rule is defined in index file in alphabetical order', t => {
3035
t.truthy(fs.existsSync(path.join('test', file)), `There are no tests for '${name}'`);
3136
}
3237

33-
t.is(Object.keys(index.rules).length, ruleFiles.length,
34-
'There are more exported rules than rule files.');
35-
t.is(Object.keys(index.configs.recommended.rules).length, ruleFiles.length,
36-
'There are more exported rules in the recommended config than rule files.');
38+
console.log(Object.keys(index.rules).length - ignoredRules.length, ruleFiles.length);
39+
40+
t.is(
41+
Object.keys(index.rules).length,
42+
ruleFiles.length,
43+
'There are more exported rules than rule files.'
44+
);
45+
t.is(
46+
Object.keys(index.configs.recommended.rules).length - ignoredRules.length,
47+
ruleFiles.length,
48+
'There are more exported rules in the recommended config than rule files.'
49+
);
3750

3851
testSorted(t, Object.keys(index.configs.recommended.rules), 'configs.recommended.rules');
3952
});
@@ -70,7 +83,7 @@ test('Every rule is defined in readme.md usage and list of rules in alphabetical
7083
t.truthy(rules.includes(name), `'${name}' is not described in the readme.md ## Rules`);
7184
}
7285

73-
t.is(Object.keys(usageRules).length, ruleFiles.length, 'There are more rules in readme.md ## Usage than rule files.');
86+
t.is(Object.keys(usageRules).length - ignoredRules.length, ruleFiles.length, 'There are more rules in readme.md ## Usage than rule files.');
7487
t.is(Object.keys(rules).length, ruleFiles.length, 'There are more rules in readme.md ## Rules than rule files.');
7588

7689
testSorted(t, Object.keys(usageRules), 'readme.md ## Usage rules');

0 commit comments

Comments
 (0)