Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
176 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
const a = 1; | ||
|
||
console.log('a', a); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
module.exports = [ | ||
{ | ||
rules: { | ||
'no-console': 'error', | ||
}, | ||
}, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
module.exports = { | ||
runner: '../../../', | ||
testMatch: ['**/__eslint__/**/*.js'], | ||
}; |
3 changes: 3 additions & 0 deletions
3
integrationTests/__fixtures__/legacy-config-at-eslint.config.js/__eslint__/file.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
const a = 1; | ||
|
||
console.log('a', a); |
5 changes: 5 additions & 0 deletions
5
integrationTests/__fixtures__/legacy-config-at-eslint.config.js/eslint.config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module.exports = { | ||
rules: { | ||
'no-console': 'error', | ||
}, | ||
}; |
3 changes: 3 additions & 0 deletions
3
integrationTests/__fixtures__/legacy-config-at-eslint.config.js/jest-runner-eslint.config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = { | ||
config: './eslint.config.js', | ||
}; |
4 changes: 4 additions & 0 deletions
4
integrationTests/__fixtures__/legacy-config-at-eslint.config.js/jest.config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
module.exports = { | ||
runner: '../../../', | ||
testMatch: ['**/__eslint__/**/*.js'], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`Works with the new flat config format 1`] = ` | ||
"FAIL __eslint__/file.js | ||
✕ no-console | ||
/mocked-path-to-jest-runner-mocha/integrationTests/__fixtures__/flat-config/__eslint__/file.js | ||
3:1 error Unexpected console statement no-console | ||
✖ 1 problem (1 error, 0 warnings) | ||
Test Suites: 1 failed, 1 total | ||
Tests: 1 failed, 1 total | ||
Snapshots: 0 total | ||
Time: | ||
Ran all test suites. | ||
" | ||
`; |
22 changes: 22 additions & 0 deletions
22
integrationTests/__snapshots__/legacy-config-at-eslint.config.js.test.js.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`Does not try to use flat config on eslint versions that don't support it 1`] = ` | ||
"PASS __eslint__/file.js | ||
● Console | ||
console.warn | ||
/mocked-path-to-jest-runner-mocha/integrationTests/__fixtures__/legacy-config-at-eslint.config.js/__eslint__/file.js | ||
3:1 warning Unexpected console statement no-console | ||
✖ 1 problem (0 errors, 1 warning) | ||
✓ ESLint | ||
Test Suites: 1 passed, 1 total | ||
Tests: 1 passed, 1 total | ||
Snapshots: 0 total | ||
Time: | ||
Ran all test suites. | ||
" | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
const { version } = require('eslint/package.json'); | ||
const semver = require('semver'); | ||
const runJest = require('./runJest'); | ||
|
||
(semver.satisfies(version, '>=8.41') ? it : it.skip)( | ||
'Works with the new flat config format', | ||
async () => { | ||
expect(await runJest('flat-config')).toMatchSnapshot(); | ||
}, | ||
); |
12 changes: 12 additions & 0 deletions
12
integrationTests/legacy-config-at-eslint.config.js.test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
const { version } = require('eslint/package.json'); | ||
const semver = require('semver'); | ||
const runJest = require('./runJest'); | ||
|
||
(semver.satisfies(version, '<8.41') ? it : it.skip)( | ||
"Does not try to use flat config on eslint versions that don't support it", | ||
async () => { | ||
expect( | ||
await runJest('legacy-config-at-eslint.config.js'), | ||
).toMatchSnapshot(); | ||
}, | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters