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

Remove the top-level expect #214

Merged
merged 1 commit into from
Sep 23, 2018
Merged

Conversation

sunesimonsen
Copy link
Member

When using the top-level expect instead of the wrapped expect, we will end up serializing errors that we shouldn't. This PR make sure that we will use the wrapped expect instead.

@coveralls
Copy link

coveralls commented Sep 22, 2018

Pull Request Test Coverage Report for Build 790

  • 27 of 27 (100.0%) changed or added relevant lines in 1 file are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage decreased (-0.09%) to 91.29%

Files with Coverage Reduction New Missed Lines %
lib/index.js 1 92.27%
Totals Coverage Status
Change from base Build 784: -0.09%
Covered Lines: 517
Relevant Lines: 547

💛 - Coveralls

@sunesimonsen
Copy link
Member Author

Before:
screen shot 2018-09-22 at 21 41 47
After:
screen shot 2018-09-22 at 21 42 25

papandreou added a commit to unexpectedjs/unexpected-messy that referenced this pull request Sep 22, 2018
Copy link
Member

@papandreou papandreou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Neat! That has been annoying me for a long time.

The same trick also works in unexpected-messy: unexpectedjs/unexpected-messy@2257aa1

Kinda feels like this should be a first class feature in Unexpected. I guess we can take a look at that when we get around to take a look at errorMode in general.

Copy link
Member

@alexjeffburke alexjeffburke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change feels like it's using the facilities available in Unexpected more appropriately - particularly like that it contains setting the errorMode in a single place.

@sunesimonsen
Copy link
Member Author

Kinda feels like this should be a first class feature in Unexpected. I guess we can take a look at that when we get around to take a look at errorMode in general.

Yes that is my thinking as well, but I wanted to try it out here first. I think we could have an:

expect.withErrorMode('bubble', () => { ... })

@sunesimonsen sunesimonsen merged commit 1ee2c9b into master Sep 23, 2018
@sunesimonsen sunesimonsen deleted the ssimonsen/remove-top-level-expect branch September 23, 2018 08:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants