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

[CLOSED] Implementation of beforeAll/afterAll #4239

Open
core-ai-bot opened this issue Aug 29, 2021 · 6 comments
Open

[CLOSED] Implementation of beforeAll/afterAll #4239

core-ai-bot opened this issue Aug 29, 2021 · 6 comments

Comments

@core-ai-bot
Copy link
Member

Issue by TomMalbran
Friday Jul 26, 2013 at 00:30 GMT
Originally opened as adobe/brackets#4581


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.


TomMalbran included the following code: https://github.com/adobe/brackets/pull/4581/commits

@core-ai-bot
Copy link
Member Author

Comment by peterflynn
Friday Jul 26, 2013 at 05:29 GMT


Nice! One quick comment: "before/afterAll()" sound easily confusable with "before/afterEach()" to me. What about "beforeFirst()" and "afterLast()"?

@core-ai-bot
Copy link
Member Author

Comment by TomMalbran
Friday Jul 26, 2013 at 05:46 GMT


"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.

@core-ai-bot
Copy link
Member Author

Comment by jasonsanjose
Tuesday Jul 30, 2013 at 20:15 GMT


Reviewing

@core-ai-bot
Copy link
Member Author

Comment by jasonsanjose
Tuesday Jul 30, 2013 at 21:02 GMT


Initial review complete. I agree with@peterflynn on the naming. Thanks for working on this cleanup@TomMalbran!

@core-ai-bot
Copy link
Member Author

Comment by TomMalbran
Wednesday Jul 31, 2013 at 02:26 GMT


@jasonsanjose Fixes pushed.

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.

@core-ai-bot
Copy link
Member Author

Comment by jasonsanjose
Wednesday Jul 31, 2013 at 18:44 GMT


@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 free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant