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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: throw on nested test declarations #9828

Merged
merged 6 commits into from Apr 17, 2020

Conversation

SimenB
Copy link
Member

@SimenB SimenB commented Apr 16, 2020

Summary

I love circus, so simple to fix 馃榾 I reused the error message from Jasmine as it made it easier to write a test for.

Fixes #9824
Fixes #9825

Test plan

E2E test added that passes for both jasmine and circus

const {asyncError, fn, mode, testName: name, timeout} = event;

if (currentlyRunningTest) {
Copy link
Member Author

Choose a reason for hiding this comment

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

should probably add this to add_hook as well

@SimenB SimenB requested a review from thymikee April 17, 2020 07:00
Copy link
Collaborator

@thymikee thymikee left a comment

Choose a reason for hiding this comment

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

LGTM

packages/jest-circus/src/eventHandler.ts Outdated Show resolved Hide resolved
@SimenB
Copy link
Member Author

SimenB commented Apr 17, 2020

Hmm, this breaks #5964. Might need to back out the hook part, and try to re-land later if FB has migrated their tests.

EDIT: Yup, need to back that part out:
image

@SimenB SimenB merged commit 3681cca into jestjs:master Apr 17, 2020
@SimenB SimenB deleted the handle-nested-test-declarations branch April 17, 2020 11:14
@SimenB
Copy link
Member Author

SimenB commented Apr 17, 2020

Disallowing hooks is kept here: https://github.com/SimenB/jest/tree/disallow-hooks-in-tests for some point in the future when we can land it

@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
3 participants