Skip to content

Commit

Permalink
[Tests] no-array-index-key: actually run valid tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Jul 24, 2024
1 parent 1b4037f commit 983b88d
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions tests/lib/rules/no-array-index-key.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const parserOptions = {

const ruleTester = new RuleTester({ parserOptions });
ruleTester.run('no-array-index-key', rule, {
valid: parsers.all(
valid: parsers.all([
{ code: '<Foo key="foo" />;' },
{ code: '<Foo key={i} />;' },
{ code: '<Foo key />;' },
Expand Down Expand Up @@ -96,9 +96,6 @@ ruleTester.run('no-array-index-key', rule, {
{
code: 'foo.flatMap((a) => <Foo key={a} />)',
},
{
code: 'foo.reduce((a, b) => a.concat(<Foo key={b.id} />), [])',
},
{
code: 'foo.reduce((a, b, i) => a.concat(<Foo key={b.id} />), [])',
},
Expand Down Expand Up @@ -139,8 +136,8 @@ ruleTester.run('no-array-index-key', rule, {
{
code: 'foo?.map(child => <Foo key={child.i} />)',
features: ['optional chaining'],
}
),
},
]),

invalid: parsers.all([].concat(
{
Expand Down

0 comments on commit 983b88d

Please sign in to comment.