9
9
listupFixtures ,
10
10
} from "./parser/test-utils" ;
11
11
import path from "path" ;
12
- import * as tsESLintParser from "@typescript-eslint/parser" ;
13
12
14
13
const FIXTURE_ROOT = path . resolve ( __dirname , "../fixtures/integrations" ) ;
15
14
@@ -22,9 +21,16 @@ function createLinter() {
22
21
}
23
22
24
23
describe ( "Integration tests." , ( ) => {
25
- for ( const { input, inputFileName, outputFileName, config } of listupFixtures (
26
- FIXTURE_ROOT ,
27
- ) ) {
24
+ for ( const {
25
+ input,
26
+ inputFileName,
27
+ outputFileName,
28
+ config,
29
+ meetRequirements,
30
+ } of listupFixtures ( FIXTURE_ROOT ) ) {
31
+ if ( ! meetRequirements ( "parse" ) ) {
32
+ continue ;
33
+ }
28
34
it ( inputFileName , ( ) => {
29
35
const setupFileName = inputFileName . replace (
30
36
/ i n p u t \. s v e l t e (?: \. [ j t ] s ) ? $ / u,
@@ -59,19 +65,11 @@ describe("Integration tests.", () => {
59
65
2 ,
60
66
) ;
61
67
62
- try {
63
- if ( fs . existsSync ( outputFileName ) ) {
64
- const output = fs . readFileSync ( outputFileName , "utf8" ) ;
65
- assert . strictEqual ( messagesJson , output ) ;
66
- } else {
67
- fs . writeFileSync ( outputFileName , messagesJson , "utf8" ) ;
68
- }
69
- } finally {
70
- // Clear type info cache
71
- tsESLintParser . parseForESLint (
72
- "" ,
73
- generateParserOptions ( { filePath : inputFileName } , config ) ,
74
- ) ;
68
+ if ( fs . existsSync ( outputFileName ) ) {
69
+ const output = fs . readFileSync ( outputFileName , "utf8" ) ;
70
+ assert . strictEqual ( messagesJson , output ) ;
71
+ } else {
72
+ fs . writeFileSync ( outputFileName , messagesJson , "utf8" ) ;
75
73
}
76
74
} ) ;
77
75
}
0 commit comments