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

Core: Run before and after hooks with module context #1559

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

raycohen
Copy link
Member

@raycohen raycohen commented Mar 4, 2021

The before and after hooks run once per module as long as there is at least one
test in the module. Using environment inheritance allows us to use the module
context in those hooks, which allows reading the expected changes to the
context from a before hook inside nested modules.

This is a breaking change and would need to be part of a major version bump.

Fixes #1328.
Ref #869.

@raycohen raycohen force-pushed the before-and-after-hooks-use-module-environment-instead-of-test-environment branch from 7ad9885 to 812788a Compare March 5, 2021 03:12
Base automatically changed from master to main March 18, 2021 18:59
The before and after hooks run once per module as long as there is at least one
test in the module. Using environment inheritance allows us to use the module
context in those hooks, which allows reading the expected changes to the
context from a before hook inside nested modules.

Fixes qunitjs#1328.
Ref qunitjs#869.
@raycohen raycohen force-pushed the before-and-after-hooks-use-module-environment-instead-of-test-environment branch from 812788a to d0958a6 Compare March 20, 2021 20:21
@Krinkle Krinkle added this to the 3.0 release milestone Apr 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Share 'before' hook test environment with child module
2 participants