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

[jest] fix lifecycle hook execution order #3461

Merged
merged 2 commits into from
Jul 1, 2023

Conversation

alexlamsl
Copy link
Contributor

No description provided.

}
} else if (DescribeScope.active) |scope| {
// calling Bun.jest() within (already active) module
if (scope.parent != null) return;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if you call Bun.jest(import.meta.path) from another file, use that same file repeatedly? They may not use a new instance of Bun.jest() each call. Basically, expect and whatnot needs to be thought of as globals even though they are not globals.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here we explicitly avoid any child describe() instances to be replaced by locally created "root" instance when Bun.jest(path) is called.

@Jarred-Sumner Jarred-Sumner merged commit 02f707f into oven-sh:main Jul 1, 2023
15 of 20 checks passed
@alexlamsl alexlamsl deleted the jest-before-after branch July 2, 2023 21:26
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

Successfully merging this pull request may close these issues.

None yet

2 participants