-
Notifications
You must be signed in to change notification settings - Fork 25k
fix(preprocessor): return object, not just code #33576
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
Conversation
|
@robhogan has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
|
sorry @robhogan, missed a spot |
Base commit: 9573d7b |
|
@robhogan has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Base commit: 9573d7b |
|
@robhogan has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
|
This pull request was successfully merged by @SimenB in e89c93f. When will my fix make it into a release? | Upcoming Releases |
Summary: Fixes #33751 Relates to #33576 Jest 28 removed support for returning a string in the process method of a transformer (https://jestjs.io/docs/upgrading-to-jest28#transformer). This PR changes assetFileTransformer to return an object instead of a string. ## Changelog [Internal] [Fixed] - Return object from assetFileTransformer Pull Request resolved: #33756 Test Plan: Tests pass with Jest 28 when this change is made. Reviewed By: cipolleschi Differential Revision: D37242038 Pulled By: cortinico fbshipit-source-id: d8a5054f5378183f644cd1458785084b26782193
Summary: Fixes #33751 Relates to #33576 Jest 28 removed support for returning a string in the process method of a transformer (https://jestjs.io/docs/upgrading-to-jest28#transformer). This PR changes assetFileTransformer to return an object instead of a string. ## Changelog [Internal] [Fixed] - Return object from assetFileTransformer Pull Request resolved: #33756 Test Plan: Tests pass with Jest 28 when this change is made. Reviewed By: cipolleschi Differential Revision: D37242038 Pulled By: cortinico fbshipit-source-id: d8a5054f5378183f644cd1458785084b26782193
Summary: Fixes facebook#33751 Relates to facebook#33576 Jest 28 removed support for returning a string in the process method of a transformer (https://jestjs.io/docs/upgrading-to-jest28#transformer). This PR changes assetFileTransformer to return an object instead of a string. ## Changelog [Internal] [Fixed] - Return object from assetFileTransformer Pull Request resolved: facebook#33756 Test Plan: Tests pass with Jest 28 when this change is made. Reviewed By: cipolleschi Differential Revision: D37242038 Pulled By: cortinico fbshipit-source-id: d8a5054f5378183f644cd1458785084b26782193
Summary: Fixes facebook#33751 Relates to facebook#33576 Jest 28 removed support for returning a string in the process method of a transformer (https://jestjs.io/docs/upgrading-to-jest28#transformer). This PR changes assetFileTransformer to return an object instead of a string. ## Changelog [Internal] [Fixed] - Return object from assetFileTransformer Pull Request resolved: facebook#33756 Test Plan: Tests pass with Jest 28 when this change is made. Reviewed By: cipolleschi Differential Revision: D37242038 Pulled By: cortinico fbshipit-source-id: d8a5054f5378183f644cd1458785084b26782193
Summary: Fixes facebook#33751 Relates to facebook#33576 Jest 28 removed support for returning a string in the process method of a transformer (https://jestjs.io/docs/upgrading-to-jest28#transformer). This PR changes assetFileTransformer to return an object instead of a string. ## Changelog [Internal] [Fixed] - Return object from assetFileTransformer Pull Request resolved: facebook#33756 Test Plan: Tests pass with Jest 28 when this change is made. Reviewed By: cipolleschi Differential Revision: D37242038 Pulled By: cortinico fbshipit-source-id: d8a5054f5378183f644cd1458785084b26782193
Summary:
Jest 28 will error if only a string is returned from a transfomer, it needs to be an object of `{code: string, map?: object}`. Returning an object has been supported since jestjs/jest#2290, released in Jest v20.
## Changelog
<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->
[Internal] [Fixed] - Return object from Jest preprocessor
Pull Request resolved: facebook#33576
Test Plan: Green CI?
Reviewed By: motiz88
Differential Revision: D35426748
Pulled By: robhogan
fbshipit-source-id: 3edb79b62b2d34274be192061817d3fcd8a7ba17
Summary
Jest 28 will error if only a string is returned from a transfomer, it needs to be an object of
{code: string, map?: object}. Returning an object has been supported since jestjs/jest#2290, released in Jest v20.Changelog
[Internal] [Fixed] - Return object from Jest preprocessor
Test Plan
Green CI?