3
3
const assert = require ( "assert" )
4
4
const path = require ( "path" )
5
5
const { ESLint } = require ( "eslint" )
6
+ const { gtEslintV8 } = require ( "../../helpers" )
7
+
6
8
const originalCwd = process . cwd ( )
7
9
8
10
describe ( "node/recommended config" , ( ) => {
9
- describe ( "in CJS directory" , ( ) => {
11
+ ; ( gtEslintV8 ? describe : describe . skip ) ( "in CJS directory" , ( ) => {
10
12
const root = path . resolve ( __dirname , "../../fixtures/configs/cjs/" )
11
13
12
14
/** @type {Linter } */
@@ -37,6 +39,7 @@ describe("node/recommended config", () => {
37
39
message :
38
40
"Parsing error: 'import' and 'export' may appear only with 'sourceType: module'" ,
39
41
ruleId : null ,
42
+ nodeType : null ,
40
43
severity : 2 ,
41
44
} ,
42
45
] )
@@ -55,6 +58,7 @@ describe("node/recommended config", () => {
55
58
message :
56
59
"Parsing error: 'import' and 'export' may appear only with 'sourceType: module'" ,
57
60
ruleId : null ,
61
+ nodeType : null ,
58
62
severity : 2 ,
59
63
} ,
60
64
] )
@@ -118,24 +122,27 @@ describe("node/recommended config", () => {
118
122
} ,
119
123
] )
120
124
} )
121
-
122
- it ( "*.cjs files should be a script." , async ( ) => {
123
- const report = await linter . lintText ( "import 'foo'" , {
124
- filePath : path . join ( root , "test.cjs" ) ,
125
- } )
126
-
127
- assert . deepStrictEqual ( report [ 0 ] . messages , [
128
- {
129
- column : 1 ,
130
- fatal : true ,
131
- line : 1 ,
132
- message :
133
- "Parsing error: 'import' and 'export' may appear only with 'sourceType: module'" ,
134
- ruleId : null ,
135
- severity : 2 ,
136
- } ,
137
- ] )
138
- } )
125
+ ; ( gtEslintV8 ? it : it . skip ) (
126
+ "*.cjs files should be a script." ,
127
+ async ( ) => {
128
+ const report = await linter . lintText ( "import 'foo'" , {
129
+ filePath : path . join ( root , "test.cjs" ) ,
130
+ } )
131
+
132
+ assert . deepStrictEqual ( report [ 0 ] . messages , [
133
+ {
134
+ column : 1 ,
135
+ fatal : true ,
136
+ line : 1 ,
137
+ message :
138
+ "Parsing error: 'import' and 'export' may appear only with 'sourceType: module'" ,
139
+ ruleId : null ,
140
+ nodeType : null ,
141
+ severity : 2 ,
142
+ } ,
143
+ ] )
144
+ }
145
+ )
139
146
140
147
it ( "*.mjs files should be a module." , async ( ) => {
141
148
const report = await linter . lintText ( "import 'foo'" , {
0 commit comments