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

feat(register): return addHook result to it can be reverted #647

Merged
merged 1 commit into from
Mar 31, 2022

Conversation

Craga89
Copy link
Contributor

@Craga89 Craga89 commented Mar 30, 2022

Currently the register method doesn't return the result of pirates#addHook, which means you can't revert the registration of the hook. This is very useful in circumstances like jest-config, which temporarily registers the transform, reads the config file, then de-registers it. See below

https://github.com/facebook/jest/blob/199f9811ae68b15879cbe18b7ef7ebd61eefcf23/packages/jest-config/src/readConfigFileAndSetRootDir.ts#L83-L101

Currently the `register` method doesn't return the result of `pirates#addHook`, which means you can't revert the registration of the hook. This is very useful in circumstances like `jest-config`, which temporarily registers the transform, reads the config file, then de-registers it. See below

https://github.com/facebook/jest/blob/199f9811ae68b15879cbe18b7ef7ebd61eefcf23/packages/jest-config/src/readConfigFileAndSetRootDir.ts#L83-101
@CLAassistant
Copy link

CLAassistant commented Mar 30, 2022

CLA assistant check
All committers have signed the CLA.

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.

3 participants