Skip to content

Commit

Permalink
chore: detect version of eslint, not its engine (#127)
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB authored Sep 17, 2021
1 parent 4042dc9 commit aeb21ae
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions integrationTests/custom-parser.test.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
const eslint = require('eslint');
const { version } = require('eslint/package.json');
const semver = require('semver');
const runJest = require('./runJest');

const isBelow6 = semver.satisfies(version, '<6');

// Note: ESLint versions <6 have a different error message for this test. The
// snapshot file contains both messages so we can test across both versions.
// Without the skipped tests for the "other" version, the tests will always fail
// with `1 snapshot obsolete`.
if (
eslint.CLIEngine.version.startsWith('4') ||
eslint.CLIEngine.version.startsWith('5')
) {
if (isBelow6) {
it.skip("Doesn't override parser when not set", () => {});
it("Doesn't override parser when not set [ESLint<6]", async () => {
expect(await runJest('custom-parser')).toMatchSnapshot();
Expand Down

0 comments on commit aeb21ae

Please sign in to comment.