diff --git a/test/rules/prefer-while/test.ts.fix b/test/rules/prefer-while/test.ts.fix index ede81d0a92d..43d120d1491 100644 --- a/test/rules/prefer-while/test.ts.fix +++ b/test/rules/prefer-while/test.ts.fix @@ -8,7 +8,17 @@ while (true===true) { console.log(x); } -// for loops with an initializer, termination condition, and incrementor should remain untouched +// for loops with an initializer, termination condition, and incrementor using '++' should remain untouched for(let x = 1; x < 10; x++) { console.log(x); } + +// for loops with an initializer, termination condition, and incrementor using '+=' should remain untouched +for (let i = 0; i < 10; x+=1) { + console.log(x); +} + +// for loops with an initializer and termination condition should remain untouched +for (let i = 0; i < 10;) { + i += 1; +} diff --git a/test/rules/prefer-while/test.ts.lint b/test/rules/prefer-while/test.ts.lint index e038d37f9e4..cc6c417132f 100644 --- a/test/rules/prefer-while/test.ts.lint +++ b/test/rules/prefer-while/test.ts.lint @@ -10,7 +10,17 @@ for(;true===true;) { console.log(x); } -// for loops with an initializer, termination condition, and incrementor should remain untouched +// for loops with an initializer, termination condition, and incrementor using '++' should remain untouched for(let x = 1; x < 10; x++) { console.log(x); } + +// for loops with an initializer, termination condition, and incrementor using '+=' should remain untouched +for (let i = 0; i < 10; x+=1) { + console.log(x); +} + +// for loops with an initializer and termination condition should remain untouched +for (let i = 0; i < 10;) { + i += 1; +}