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

test: use expectAsync for rejections #831

Merged
merged 1 commit into from
Jan 12, 2020

Conversation

raphinesse
Copy link
Contributor

Motivation and Context

Make use of expectAsync (available since Jasmine 3.5) to check for expected rejections. This makes for shorter and clearer expectations

This also fixes a test that would otherwise break with apache/cordova-common#121

Description

Uses expectAsync(...).toBeRejectedWithError(...) and expectAsync(...).toBeRejectedWith(...) to replace rejection checking that was done with fail() before. Where it greatly improved readability I switched the tests to async/await.

Testing

npm t

@codecov-io
Copy link

codecov-io commented Jan 12, 2020

Codecov Report

Merging #831 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #831   +/-   ##
=======================================
  Coverage   89.72%   89.72%           
=======================================
  Files          46       46           
  Lines        2132     2132           
=======================================
  Hits         1913     1913           
  Misses        219      219

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 214dca1...5572140. Read the comment docs.

@raphinesse raphinesse merged commit f7f9343 into apache:master Jan 12, 2020
@raphinesse raphinesse deleted the expect-async branch January 12, 2020 12:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants