Skip to content

Commit 2b64e94

Browse files
committed
test: improve testing performance
1 parent e417eb8 commit 2b64e94

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

packages/plugins/eslint-plugin-react-core/src/rules/no-leaked-conditional-rendering.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import dedent from "dedent";
22

3-
import { allValid, ruleTester } from "../../../../../test";
3+
import { allValid, ruleTesterWithTypes } from "../../../../../test";
44
import rule, { RULE_NAME } from "./no-leaked-conditional-rendering";
55

6-
ruleTester.run(RULE_NAME, rule, {
6+
ruleTesterWithTypes.run(RULE_NAME, rule, {
77
invalid: [
88
{
99
code: dedent`

test/rule-tester.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,15 @@ export function getFixturesRootDir(): string {
1212
}
1313

1414
export const defaultLanguageOptions = {
15+
ecmaVersion: "latest",
16+
parser: tsEsLintParser,
17+
parserOptions: {
18+
ecmaFeatures: { jsx: true },
19+
},
20+
sourceType: "module",
21+
} as const;
22+
23+
export const defaultLanguageOptionsWithTypes = {
1524
ecmaVersion: "latest",
1625
parser: tsEsLintParser,
1726
parserOptions: {
@@ -23,3 +32,5 @@ export const defaultLanguageOptions = {
2332
} as const;
2433

2534
export const ruleTester = new RuleTester({ languageOptions: defaultLanguageOptions } as never);
35+
36+
export const ruleTesterWithTypes = new RuleTester({ languageOptions: defaultLanguageOptionsWithTypes } as never);

0 commit comments

Comments
 (0)