Skip to content

Commit

Permalink
Remove broken snapshots & tests for unsupported eslint versions
Browse files Browse the repository at this point in the history
  • Loading branch information
cprussin authored and ljharb committed Apr 27, 2023
1 parent 75e0aaf commit c4b2b9d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 59 deletions.
36 changes: 0 additions & 36 deletions integrationTests/__snapshots__/custom-parser.test.js.snap
Original file line number Diff line number Diff line change
@@ -1,41 +1,5 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Doesn't override parser when not set [ESLint<6] 1`] = `
"FAIL integrationTests/__fixtures__/custom-parser/__eslint__/file.js
● Test suite failed to run
Cannot find module 'this-parser-does-not-exist'
at ModuleResolver.resolve (../../../node_modules/eslint/lib/util/module-resolver.js:72:19)
Test Suites: 1 failed, 1 total
Tests: 0 total
Snapshots: 0 total
Time:
Ran all test suites.
"
`;

exports[`Doesn't override parser when not set [ESLint=6] 1`] = `
"FAIL integrationTests/__fixtures__/custom-parser/__eslint__/file.js
● Test suite failed to run
Failed to load parser 'this-parser-does-not-exist' declared in 'integrationTests/__fixtures__/custom-parser/.eslintrc.json': Cannot find module 'this-parser-does-not-exist'
Require stack:
- /mocked-path-to-jest-runner-mocha/integrationTests/__fixtures__/custom-parser/.eslintrc.json
at Object.resolve (../../../node_modules/eslint/lib/shared/relative-module-resolver.js:44:50)
at _normalizeObjectConfigDataBody.next (<anonymous>)
at _normalizeObjectConfigData.next (<anonymous>)
Test Suites: 1 failed, 1 total
Tests: 0 total
Snapshots: 0 total
Time:
Ran all test suites.
"
`;
exports[`Doesn't override parser when not set [ESLint=7] 1`] = `
"FAIL __eslint__/file.js
● Test suite failed to run
Expand Down
28 changes: 5 additions & 23 deletions integrationTests/custom-parser.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,18 @@ const { version } = require('eslint/package.json');
const semver = require('semver');
const runJest = require('./runJest');

// Note: ESLint versions <6, 6, 7, >7 each have a different error message or
// stack for this test. The snapshot file contains all messages so we can test
// across versions. Without the skipped tests for the other versions, the tests
// will always fail with `1 snapshot obsolete`.
if (semver.satisfies(version, '<6')) {
// Note: ESLint versions 7 and 8 have a different error message or stack for
// this test. The snapshot file contains all messages so we can test across
// versions. Without the skipped tests for the other versions, the tests will
// always fail with `1 snapshot obsolete`.
if (semver.satisfies(version, '7')) {
it.skip("Doesn't override parser when not set", () => {});
it.skip("Doesn't override parser when not set [ESLint=6]", () => {});
it.skip("Doesn't override parser when not set [ESLint=7]", () => {});
it("Doesn't override parser when not set [ESLint<6]", async () => {
expect(await runJest('custom-parser')).toMatchSnapshot();
});
} else if (semver.satisfies(version, '6')) {
it.skip("Doesn't override parser when not set", () => {});
it.skip("Doesn't override parser when not set [ESLint<6]", () => {});
it.skip("Doesn't override parser when not set [ESLint=7]", () => {});
it("Doesn't override parser when not set [ESLint=6]", async () => {
expect(await runJest('custom-parser')).toMatchSnapshot();
});
} else if (semver.satisfies(version, '7')) {
it.skip("Doesn't override parser when not set", () => {});
it.skip("Doesn't override parser when not set [ESLint<6]", () => {});
it.skip("Doesn't override parser when not set [ESLint=6]", () => {});
it("Doesn't override parser when not set [ESLint=7]", async () => {
expect(await runJest('custom-parser')).toMatchSnapshot();
});
} else {
it("Doesn't override parser when not set", async () => {
expect(await runJest('custom-parser')).toMatchSnapshot();
});
it.skip("Doesn't override parser when not set [ESLint<6]", () => {});
it.skip("Doesn't override parser when not set [ESLint=6]", () => {});
it.skip("Doesn't override parser when not set [ESLint=7]", () => {});
}

0 comments on commit c4b2b9d

Please # to comment.