Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

Commit

Permalink
Coalesce test cases
Browse files Browse the repository at this point in the history
- Combine test cases for 'bad' for loops and case for 'good' for loops
- Remove unneeded files
- Add comments to test cases
  • Loading branch information
rwaskiewicz committed May 2, 2018
1 parent ec8b337 commit 8fa8062
Show file tree
Hide file tree
Showing 10 changed files with 30 additions and 27 deletions.
3 changes: 0 additions & 3 deletions test/rules/prefer-while/bad-no-condition/test.ts.fix

This file was deleted.

4 changes: 0 additions & 4 deletions test/rules/prefer-while/bad-no-condition/test.ts.lint

This file was deleted.

3 changes: 0 additions & 3 deletions test/rules/prefer-while/bad-with-condition/test.ts.fix

This file was deleted.

4 changes: 0 additions & 4 deletions test/rules/prefer-while/bad-with-condition/test.ts.lint

This file was deleted.

5 changes: 0 additions & 5 deletions test/rules/prefer-while/bad-with-condition/tslint.json

This file was deleted.

3 changes: 0 additions & 3 deletions test/rules/prefer-while/good/test.ts.lint

This file was deleted.

5 changes: 0 additions & 5 deletions test/rules/prefer-while/good/tslint.json

This file was deleted.

14 changes: 14 additions & 0 deletions test/rules/prefer-while/test.ts.fix
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// for loops without an initializer, termination condition, and incrementor should be updated
while (true) {
console.log(x);
}

// for loops without an initializer and incrementor should be updated
while (true===true) {
console.log(x);
}

// for loops with an initializer, termination condition, and incrementor should remain untouched
for(let x = 1; x < 10; x++) {
console.log(x);
}
16 changes: 16 additions & 0 deletions test/rules/prefer-while/test.ts.lint
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// for loops without an initializer, termination condition, and incrementor should be updated
for(;;) {
~~~~~~~ [Prefer `while` loops instead of `for` loops without an initializer and incrementor.]
console.log(x);
}

// for loops without an initializer and incrementor should be updated
for(;true===true;) {
~~~~~~~~~~~~~~~~~~ [Prefer `while` loops instead of `for` loops without an initializer and incrementor.]
console.log(x);
}

// for loops with an initializer, termination condition, and incrementor should remain untouched
for(let x = 1; x < 10; x++) {
console.log(x);
}

0 comments on commit 8fa8062

Please sign in to comment.