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

Freeze the top-level expect #517

Merged
merged 2 commits into from Sep 29, 2018
Merged

Freeze the top-level expect #517

merged 2 commits into from Sep 29, 2018

Conversation

@papandreou
Copy link
Member

@papandreou papandreou commented Sep 28, 2018

As discussed on #476

@alexjeffburke alexjeffburke mentioned this pull request Sep 28, 2018
5 of 5 tasks complete
Copy link
Member

@alexjeffburke 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!

Copy link
Member

@sunesimonsen sunesimonsen left a comment

👍

Did you see any performance penalty?

@papandreou
Copy link
Member Author

@papandreou 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
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 mentioned this pull request Jan 3, 2019
25 of 25 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants