Skip to content

Commit 983b88d

Browse files
committed
[Tests] no-array-index-key: actually run valid tests
1 parent 1b4037f commit 983b88d

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

tests/lib/rules/no-array-index-key.js

+3-6
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const parserOptions = {
2727

2828
const ruleTester = new RuleTester({ parserOptions });
2929
ruleTester.run('no-array-index-key', rule, {
30-
valid: parsers.all(
30+
valid: parsers.all([
3131
{ code: '<Foo key="foo" />;' },
3232
{ code: '<Foo key={i} />;' },
3333
{ code: '<Foo key />;' },
@@ -96,9 +96,6 @@ ruleTester.run('no-array-index-key', rule, {
9696
{
9797
code: 'foo.flatMap((a) => <Foo key={a} />)',
9898
},
99-
{
100-
code: 'foo.reduce((a, b) => a.concat(<Foo key={b.id} />), [])',
101-
},
10299
{
103100
code: 'foo.reduce((a, b, i) => a.concat(<Foo key={b.id} />), [])',
104101
},
@@ -139,8 +136,8 @@ ruleTester.run('no-array-index-key', rule, {
139136
{
140137
code: 'foo?.map(child => <Foo key={child.i} />)',
141138
features: ['optional chaining'],
142-
}
143-
),
139+
},
140+
]),
144141

145142
invalid: parsers.all([].concat(
146143
{

0 commit comments

Comments
 (0)