diff --git a/tests/src/rules/order.js b/tests/src/rules/order.js index 4f86fc9f8..04236420c 100644 --- a/tests/src/rules/order.js +++ b/tests/src/rules/order.js @@ -1373,7 +1373,7 @@ ruleTester.run('order', rule, { }], })), // fix incorrect order with typescript-eslint-parser - testVersion('<6.0.0', { + testVersion('<6.0.0', () => ({ code: ` var async = require('async'); var fs = require('fs'); @@ -1387,9 +1387,9 @@ ruleTester.run('order', rule, { ruleId: 'order', message: '`fs` import should occur before import of `async`', }], - }), + })), // fix incorrect order with @typescript-eslint/parser - testVersion('>5.0.0', { + testVersion('>5.0.0', () => ({ code: ` var async = require('async'); var fs = require('fs'); @@ -1403,6 +1403,6 @@ ruleTester.run('order', rule, { ruleId: 'order', message: '`fs` import should occur before import of `async`', }], - }), + })), ].filter((t) => !!t), }) diff --git a/tests/src/utils.js b/tests/src/utils.js index a842b788a..9d71ad84a 100644 --- a/tests/src/utils.js +++ b/tests/src/utils.js @@ -12,7 +12,7 @@ export function testFilePath(relativePath) { export const FILENAME = testFilePath('foo.js') export function testVersion(specifier, t) { - return semver.satisfies(eslintPkg.version, specifier) && test(t) + return semver.satisfies(eslintPkg.version, specifier) && test(t()) } export function test(t) {