Skip to content

Commit

Permalink
tests: remove tests for older ESLint versions (#88)
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelDeBoey authored Jul 31, 2023
1 parent bcb493a commit 9a6a975
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 12 deletions.
6 changes: 1 addition & 5 deletions tests/lib/illegal-eslint-disable-line.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ const fs = require("fs")
const path = require("path")
const spawn = require("cross-spawn")
const rimraf = require("rimraf")
const semver = require("semver")
const eslintVersion = require("eslint/package").version

/**
* Run eslint CLI command with a given source code.
Expand Down Expand Up @@ -89,9 +87,7 @@ no-undef*/
]) {
it(code, () =>
runESLint(code).then(messages => {
if (semver.satisfies(eslintVersion, ">=5.0.0")) {
assert.strictEqual(messages.length > 0, true)
}
assert.strictEqual(messages.length > 0, true)
const normalMessages = messages.filter(
message => message.ruleId != null
)
Expand Down
4 changes: 2 additions & 2 deletions tests/lib/rules/disable-enable-pair.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ var foo = 1
options: [{ allowWholeFile: true }],
},
// -- description
...(semver.satisfies(eslintVersion, ">=7.0.0 || <6.0.0")
...(semver.satisfies(eslintVersion, ">=7.0.0")
? [
`
/*eslint-disable no-undef -- description*/
Expand Down Expand Up @@ -211,7 +211,7 @@ console.log();
],
},
// -- description
...(semver.satisfies(eslintVersion, ">=7.0.0 || <6.0.0")
...(semver.satisfies(eslintVersion, ">=7.0.0")
? [
{
code: `
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/rules/no-aggregating-enable.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ tester.run("no-aggregating-enable", rule, {
],
},
// -- description
...(semver.satisfies(eslintVersion, ">=7.0.0 || <6.0.0")
...(semver.satisfies(eslintVersion, ">=7.0.0")
? [
{
code: `
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/rules/no-duplicate-disable.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ tester.run("no-duplicate-disable", rule, {
],
},
// -- description
...(semver.satisfies(eslintVersion, ">=7.0.0 || <6.0.0")
...(semver.satisfies(eslintVersion, ">=7.0.0")
? [
{
code: `
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/rules/no-restricted-disable.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ tester.run("no-restricted-disable", rule, {
],
},
// -- description
...(semver.satisfies(eslintVersion, ">=7.0.0 || <6.0.0")
...(semver.satisfies(eslintVersion, ">=7.0.0")
? [
{
code: "/*eslint-disable -- description*/",
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/rules/no-unlimited-disable.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ tester.run("no-unlimited-disable", rule, {
],
},
// -- description
...(semver.satisfies(eslintVersion, ">=7.0.0 || <6.0.0")
...(semver.satisfies(eslintVersion, ">=7.0.0")
? [
{
code: "/*eslint-disable -- description */",
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/rules/no-unused-enable.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ var a = b
],
},
// -- description
...(semver.satisfies(eslintVersion, ">=7.0.0 || <6.0.0")
...(semver.satisfies(eslintVersion, ">=7.0.0")
? [
{
code: "/*eslint-enable -- description*/",
Expand Down

0 comments on commit 9a6a975

Please sign in to comment.