You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 6, 2021. It is now read-only.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This pull request adds the functions beforeAll and afterAll to be used inside any test suite. With these functions we can better create a test window for a complete test suite and close it at the end. Hopefully, if jasmine finally implements them, we won't need to rewrite anything besides removing the additional code added on this PR.
I then updated the test suites that used a single window for all the tests to use this new functions.
"beforeFirst()" and "afterLast()" sound better. I went with "before/afterAll()" because I looked like the names jasmine could use to name the APIs, but it doesn't seem that they will add this functions to jasmine, so we could go with different names.
One think to notice is that when to chained suites have before or after all functions, the child suite functions will be called first, since we iterate from the spec parent to i'ts parents. Maybe this behavior could be reversed for the before first functions, having the outer most being called first and inner after.
@TomMalbran It's not an issue with the current usage, but I agree I think that running the highest ancestor beforeFirst callbacks before the lower ones is a good change to make. I'll merge this now and we can follow up later.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
None yet
3 participants
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.
This pull request adds the functions
beforeAll
andafterAll
to be used inside any test suite. With these functions we can better create a test window for a complete test suite and close it at the end. Hopefully, if jasmine finally implements them, we won't need to rewrite anything besides removing the additional code added on this PR.I then updated the test suites that used a single window for all the tests to use this new functions.