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

Freeze the top-level expect #517

Merged
merged 2 commits into from Sep 29, 2018

Conversation

Projects
None yet
3 participants
@papandreou
Copy link
Member

papandreou commented Sep 28, 2018

As discussed on #476

papandreou added some commits Sep 28, 2018

@papandreou papandreou added the Major label Sep 28, 2018

@alexjeffburke alexjeffburke referenced this pull request Sep 28, 2018

Closed

Unexpected 11 #491

5 of 5 tasks complete
@alexjeffburke
Copy link
Member

alexjeffburke left a comment

Big 👍 from me - I think this removes a sizeable footgun for those using the library the first time.

I do wonder if we want to add a task to revise the sections talking about adding assertions and using plugins to make this new reality clear.

@sunesimonsen sunesimonsen added this to the v11 milestone Sep 29, 2018

topLevelExpect.addAssertion('<any> to foo', function() {});
},
'to throw',
'Cannot add an assertion to a frozen instance, please run .clone() first'

This comment has been minimized.

@sunesimonsen

sunesimonsen Sep 29, 2018

Member

I think this is clear!

@sunesimonsen
Copy link
Member

sunesimonsen left a comment

👍

Did you see any performance penalty?

@papandreou

This comment has been minimized.

Copy link
Member

papandreou commented Sep 29, 2018

I can't imagine there would be? The only change is that add* will check a boolean _frozen property and throw if it's true.

@papandreou papandreou merged commit 705a820 into v11 Sep 29, 2018

3 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
coverage/coveralls Coverage remained the same at 98.181%
Details

@papandreou papandreou deleted the feature/freezeTopLevelExpect branch Sep 29, 2018

@sunesimonsen sunesimonsen referenced this pull request Jan 3, 2019

Merged

V11 (Major) #509

25 of 25 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment