Skip to content

Commit

Permalink
More tests
Browse files Browse the repository at this point in the history
  • Loading branch information
fisker committed May 25, 2020
1 parent 36a1213 commit d8c342f
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion test/no-for-loop.js
Expand Up @@ -521,7 +521,7 @@ ruleTester.run('no-for-loop', rule, {
}
`, outdent`
for (const element_ of arr) {
function element__(element__) {
function element__(element) {
console.log(element_, element);
}
}
Expand All @@ -548,6 +548,24 @@ ruleTester.run('no-for-loop', rule, {
console.log(element_, element);
}
`),
testCase(outdent`
for (let element = 0; element < arr.length; element += 1) {
console.log(element, arr[element]);
}
`, outdent`
for (const [element, element_] of arr.entries()) {
console.log(element, element_);
}
`),
testCase(outdent`
for (let element = 0; element < arr.length; element += 1) {
console.log(arr[element]);
}
`, outdent`
for (const element_ of arr) {
console.log(element_);
}
`),
testCase(outdent`
for (const element of arr) {
for (let j = 0; j < arr2.length; j += 1) {
Expand Down

0 comments on commit d8c342f

Please sign in to comment.