Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(valid-expect-in-promise): re-implement rule #916

Merged
merged 23 commits into from
Oct 9, 2021
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
28e5b61
feat(valid-expect-in-promise): re-write implementation
G-Rath Sep 26, 2021
f88a6e6
fix(valid-expect-in-promise): check number of arguments being passed
G-Rath Sep 26, 2021
4f7357f
fix(valid-expect-in-promise): bailout if `done` callback is present
G-Rath Sep 26, 2021
5d1d419
fix(valid-expect-in-promise): allow awaited promises
G-Rath Sep 26, 2021
c914556
fix(valid-expect-in-promise): handle multi-chained promises properly
G-Rath Oct 2, 2021
2973335
fix(valid-expect-in-promise): handle promises assigned to variables
G-Rath Oct 2, 2021
c5d0ffc
refactor(valid-expect-in-promise): adjust conditions to dedent code
G-Rath Oct 2, 2021
48a62c2
fix(valid-expect-in-promise): allow variables assigned awaited promises
G-Rath Oct 2, 2021
2175025
feat(valid-expect-in-promise): track promise vars across reassignments
G-Rath Oct 2, 2021
f5c0020
feat(valid-expect-in-promise): support blocks and multi-variable assigns
G-Rath Oct 3, 2021
099b27a
feat(valid-expect-in-promise): support re-assignment promise chaining
G-Rath Oct 3, 2021
e10900d
refactor(valid-expect-in-promise): remove unneeded condition
G-Rath Oct 3, 2021
d966f01
refactor(valid-expect-in-promise): inline reporting function
G-Rath Oct 3, 2021
d9fa516
fix(valid-expect-in-promise): rewrite rule message to be clearer
G-Rath Oct 3, 2021
5142136
fix(valid-expect-in-promise): rewrite rule description to be clearer
G-Rath Oct 3, 2021
11b8469
fix(valid-expect-in-promise): ignore unreachable code after return
G-Rath Oct 3, 2021
c49f704
fix(valid-expect-in-promise): support `Promise.all`
G-Rath Oct 3, 2021
3491dd7
fix(valid-expect-in-promise): support `resolve` & `reject` methods
G-Rath Oct 3, 2021
72bc5d6
refactor(valid-expect-in-promise): remove unneeded optional chain
G-Rath Oct 4, 2021
0b46e0f
refactor(valid-expect-in-promise): adjust conditions slightly
G-Rath Oct 8, 2021
5e5de47
chore(valid-expect-in-promise): add a bunch of comments
G-Rath Oct 8, 2021
c664be1
feat(valid-expect-in-promise): support `Promise.allSettled`
G-Rath Oct 8, 2021
8f9ccf5
docs(valid-expect-in-promise): add more examples and reword
G-Rath Oct 9, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ installations requiring long-term consistency.
| [require-top-level-describe](docs/rules/require-top-level-describe.md) | Require test cases and hooks to be inside a `describe` block | | |
| [valid-describe](docs/rules/valid-describe.md) | Enforce valid `describe()` callback | ![recommended][] | |
| [valid-expect](docs/rules/valid-expect.md) | Enforce valid `expect()` usage | ![recommended][] | |
| [valid-expect-in-promise](docs/rules/valid-expect-in-promise.md) | Enforce having return statement when testing with promises | ![recommended][] | |
| [valid-expect-in-promise](docs/rules/valid-expect-in-promise.md) | Ensure promises that have expectations in their chain are valid | ![recommended][] | |
| [valid-title](docs/rules/valid-title.md) | Enforce valid titles | ![recommended][] | ![fixable][] |

<!-- end base rules list -->
Expand Down
2 changes: 1 addition & 1 deletion docs/rules/valid-expect-in-promise.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Enforce having return statement when testing with promises (`valid-expect-in-promise`)
# Ensure promises that have expectations in their chain are valid (`valid-expect-in-promise`)

Ensure to return promise when having assertions in `then` or `catch` block of
promise
Expand Down
Loading