From 112261cbc84f5b7d74de9b427b529a10b41faece Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Sat, 30 Apr 2022 14:32:15 -0700 Subject: [PATCH] [Tests] skip fragment tests in eslint < 6 --- __tests__/src/rules/role-supports-aria-props-test.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/__tests__/src/rules/role-supports-aria-props-test.js b/__tests__/src/rules/role-supports-aria-props-test.js index 8995e6f70..801b747c2 100644 --- a/__tests__/src/rules/role-supports-aria-props-test.js +++ b/__tests__/src/rules/role-supports-aria-props-test.js @@ -12,6 +12,8 @@ import { roles, } from 'aria-query'; import { RuleTester } from 'eslint'; +import { version as eslintVersion } from 'eslint/package.json'; +import semver from 'semver'; import parserOptionsMapper from '../../__util__/parserOptionsMapper'; import rule from '../../../src/rules/role-supports-aria-props'; @@ -72,7 +74,7 @@ const createTests = (rolesNames) => rolesNames.reduce((tests, role) => { const [validTests, invalidTests] = createTests(nonAbstractRoles); ruleTester.run('role-supports-aria-props', rule, { - valid: [ + valid: [].concat( { code: '' }, { code: '
' }, { code: '
' }, @@ -392,7 +394,7 @@ ruleTester.run('role-supports-aria-props', rule, { { code: '
' }, { code: '
' }, - { + semver.satisfies(eslintVersion, '>= 6') ? { code: ` const HelloThere = () => (
{props.frag}
; `, - }, - - ].concat(validTests).map(parserOptionsMapper), + } : [], + validTests, + ).map(parserOptionsMapper), invalid: [ // implicit basic checks