Skip to content

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

Closed
raycohen wants to merge 1 commit intoqunitjs:mainfrom
raycohen:before-and-after-hooks-use-module-environment-instead-of-test-environment
Closed

Core: Run before and after hooks with module context#1559
raycohen wants to merge 1 commit intoqunitjs:mainfrom
raycohen:before-and-after-hooks-use-module-environment-instead-of-test-environment

Conversation

@raycohen
Copy link
Copy Markdown
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
@raycohen raycohen requested review from Krinkle and gibson042 March 20, 2021 20:29
@Krinkle Krinkle added this to the 3.0 release milestone Apr 10, 2021
@raycohen
Copy link
Copy Markdown
Member Author

raycohen commented Jun 9, 2024

replaced by #1762

@raycohen raycohen closed this Jun 9, 2024
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