Skip to content

Commit

Permalink
name test suites for each parser
Browse files Browse the repository at this point in the history
  • Loading branch information
eps1lon committed Sep 9, 2020
1 parent 5937eb6 commit 5477ecd
Showing 1 changed file with 42 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7962,32 +7962,46 @@ if (!process.env.CI) {
testsTypescript.invalid = testsTypescript.invalid.filter(predicate);
}

const parserOptions = {
ecmaVersion: 6,
sourceType: 'module',
};
describe('react-hooks', () => {
const parserOptions = {
ecmaVersion: 6,
sourceType: 'module',
};

new ESLintTester({
parser: require.resolve('babel-eslint'),
parserOptions,
}).run('react-hooks', ReactHooksESLintRule, tests);

new ESLintTester({
parser: require.resolve('@babel/eslint-parser'),
parserOptions,
}).run('react-hooks', ReactHooksESLintRule, tests);

new ESLintTester({
parser: require.resolve('@typescript-eslint/parser-v2'),
parserOptions,
}).run('react-hooks', ReactHooksESLintRule, testsTypescript);

new ESLintTester({
parser: require.resolve('@typescript-eslint/parser-v3'),
parserOptions,
}).run('react-hooks', ReactHooksESLintRule, testsTypescript);

new ESLintTester({
parser: require.resolve('@typescript-eslint/parser-v4'),
parserOptions,
}).run('react-hooks', ReactHooksESLintRule, testsTypescript);
new ESLintTester({
parser: require.resolve('babel-eslint'),
parserOptions,
}).run('parser: babel-eslint', ReactHooksESLintRule, tests);

new ESLintTester({
parser: require.resolve('@babel/eslint-parser'),
parserOptions,
}).run('parser: @babel/eslint-parser', ReactHooksESLintRule, tests);

new ESLintTester({
parser: require.resolve('@typescript-eslint/parser-v2'),
parserOptions,
}).run(
'parser: @typescript-eslint/[email protected]',
ReactHooksESLintRule,
testsTypescript
);

new ESLintTester({
parser: require.resolve('@typescript-eslint/parser-v3'),
parserOptions,
}).run(
'parser: @typescript-eslint/[email protected]',
ReactHooksESLintRule,
testsTypescript
);

new ESLintTester({
parser: require.resolve('@typescript-eslint/parser-v4'),
parserOptions,
}).run(
'parser: @typescript-eslint/[email protected]',
ReactHooksESLintRule,
testsTypescript
);
});

0 comments on commit 5477ecd

Please sign in to comment.