Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Return and handle promises in tests #5340
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
Return and handle promises in tests #5340
Changes from 25 commits
f4ae59c
67d0973
7b73542
6bcaa90
10689cc
49c1cfd
0bd2a8e
ce5320a
db8563e
acc6707
efee80b
97574f9
a4285e5
bc1bce4
1a69837
e6555b0
cdfaadf
b70e728
c12b3e8
3bccdb1
892707f
329e915
5769cde
ec53d29
7f90732
2c0b913
2853691
1694bb4
3a313e7
33b72e1
5a127f0
97596ae
149701e
9753fb9
bbe25ef
70ec83a
cd809a2
6de8082
646cb2c
ce51c69
d0d14b8
5a3110a
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, good catch, this is a tricky one - for context, we used to call this function
fail
but changed it tofailTest
becausefail
is a global created by Jasmine to manually cause a test to fail. This mostly worked though it's not great to override a global. But the big problem came when we occasionally forgot to import ourfail_test
and ended up using the Jasmine global - which would just swallow the failure.That said I notice there's a
done.fail
and in fact in v3 smarterdone
behavior that looks like it should makefailTest
obsolete - instead of.catch(failTest).then(done)
we may be able to do just.then(done, done.fail)
or perhaps even.then(done, done)
Definitely not something we need to do now, and it would take some experimentation to be sure this is going to fail correctly with at least as much information as
failTest
gives us.