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

fix(jest): Allow being used inside Jest beforeAll #76

Merged
merged 2 commits into from
Jul 27, 2022

Conversation

kopax-polyconseil
Copy link
Contributor

Fix #72

Copy link
Owner

@JoshuaKGoldberg JoshuaKGoldberg left a comment

Choose a reason for hiding this comment

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

Super, thanks so much for this @kopax-polyconseil! 🎉

I tested this out locally and it seems to work in all the situations that previously worked. Though, adding a beforeAll(() => { cft(); } in a test file or setupTests.js still fails for me with this setup. If you moved the (after|before)EachCallback = () => {}; and (after|before)Each(() => ... lines to outside getJestEnvironment -and changed the latter to only call if the function is defined- that does fix it. 🤷 if it works for you as-is in this PR, then great!

src/environments/jest.ts Show resolved Hide resolved
@JoshuaKGoldberg JoshuaKGoldberg merged commit 88952fb into JoshuaKGoldberg:main Jul 27, 2022
@JoshuaKGoldberg
Copy link
Owner

Ah, and I no longer have access to publish this package (it used to be under Codecademy) -- will work on that behind the scenes with @jakemhiller.

@JoshuaKGoldberg
Copy link
Owner

Update: this should be published as console-fail-test@0.1.6. Thanks @jakemhiller!

@kopax-polyconseil kopax-polyconseil deleted the patch-1 branch August 2, 2022 13:50
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.

Allow being used inside Jest beforeAll
2 participants