diff --git a/__tests__/src/rules/img-redundant-alt-test.js b/__tests__/src/rules/img-redundant-alt-test.js index 0ae38a349..e4ce2658f 100644 --- a/__tests__/src/rules/img-redundant-alt-test.js +++ b/__tests__/src/rules/img-redundant-alt-test.js @@ -30,8 +30,7 @@ const expectedError = { }; ruleTester.run('img-redundant-alt', rule, { - valid: semver.satisfies(eslintVersion, '>= 6') ? [{ code: '{imageAlt?.name}', parserOptions: { ecmaVersion: 2020 } }, - { code: 'Doing cool things', parserOptions: { ecmaVersion: 2020 } }].map(parserOptionsMapper) : [ + valid: [].concat( { code: 'foo;' }, { code: 'picture of me taking a photo of an image' }, { code: 'photo of image' }, @@ -58,9 +57,13 @@ ruleTester.run('img-redundant-alt', rule, { { code: '' }, { code: '{imageAlt}' }, { code: '{imageAlt.name}' }, + semver.satisfies(eslintVersion, '>= 6') ? [ + { code: '{imageAlt?.name}', parserOptions: { ecmaVersion: 2020 } }, + { code: 'Doing cool things', parserOptions: { ecmaVersion: 2020 } }, + ] : [], { code: 'Photography;' }, { code: 'ImageMagick;' }, - ].map(parserOptionsMapper), + ).map(parserOptionsMapper), invalid: [ { code: 'Photo of friend.;', errors: [expectedError] }, { code: 'Picture of friend.;', errors: [expectedError] },