From 790d9afa9eeebaacb14624267a4923405e16a1f7 Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Tue, 9 Nov 2021 16:07:32 -0800 Subject: [PATCH] [Tests] skip 2020 test in eslint < 6 --- tests/src/rules/no-import-module-exports.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/src/rules/no-import-module-exports.js b/tests/src/rules/no-import-module-exports.js index 0c3718cef..a40eb7e27 100644 --- a/tests/src/rules/no-import-module-exports.js +++ b/tests/src/rules/no-import-module-exports.js @@ -1,7 +1,7 @@ import path from 'path'; import { RuleTester } from 'eslint'; -import { test } from '../utils'; +import { test, testVersion } from '../utils'; const ruleTester = new RuleTester({ parserOptions: { ecmaVersion: 6, sourceType: 'module' }, @@ -15,7 +15,7 @@ const error = { }; ruleTester.run('no-import-module-exports', rule, { - valid: [ + valid: [].concat( test({ code: ` const thing = require('thing') @@ -64,7 +64,7 @@ ruleTester.run('no-import-module-exports', rule, { `, filename: path.join(process.cwd(), 'tests/files/missing-entrypoint/cli.js'), }), - test({ + testVersion('>= 6', () => ({ code: ` import fs from 'fs/promises'; @@ -113,8 +113,8 @@ ruleTester.run('no-import-module-exports', rule, { parserOptions: { ecmaVersion: 2020, }, - }), - ], + })) || [], + ), invalid: [ test({ code: `