From c4b2b9dd9fe94b1a01b679ed7a5da8e5355e60d5 Mon Sep 17 00:00:00 2001 From: Connor Prussin Date: Thu, 27 Apr 2023 00:15:42 -0700 Subject: [PATCH] Remove broken snapshots & tests for unsupported eslint versions --- .../__snapshots__/custom-parser.test.js.snap | 36 ------------------- integrationTests/custom-parser.test.js | 28 +++------------ 2 files changed, 5 insertions(+), 59 deletions(-) diff --git a/integrationTests/__snapshots__/custom-parser.test.js.snap b/integrationTests/__snapshots__/custom-parser.test.js.snap index aaf3c39..bea2046 100644 --- a/integrationTests/__snapshots__/custom-parser.test.js.snap +++ b/integrationTests/__snapshots__/custom-parser.test.js.snap @@ -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 () - at _normalizeObjectConfigData.next () - -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 diff --git a/integrationTests/custom-parser.test.js b/integrationTests/custom-parser.test.js index d40f758..88fbf8d 100644 --- a/integrationTests/custom-parser.test.js +++ b/integrationTests/custom-parser.test.js @@ -2,28 +2,12 @@ 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(); }); @@ -31,7 +15,5 @@ if (semver.satisfies(version, '<6')) { 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]", () => {}); }