You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Support asynchronous functions for createTransformer in the transformer API.
Motivation
Support asynchronous operations in createTransformer. In my case, I need to perform some pre/post processing around an existing transformer which is an esm modules.
Example
exportconstcreateTransformer=async(options)=>{const{ process }=awaitimport(options.path);return{process: (content,path,options)=>{console.log("pre-processing here");constresult=process(content,path,options);console.log("post-processing here");returnresult;},};};
Pitch
Currently there is now way to perform asynchronous operations in createTransformer which is needlessly restrictive. Indeed, it seems this would only require but minimal code changes because the createTransformer is already called inside an asynchronous function.
This issue 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.
🚀 Feature Proposal
Support asynchronous functions for
createTransformer
in the transformer API.Motivation
Support asynchronous operations in
createTransformer
. In my case, I need to perform some pre/post processing around an existing transformer which is an esm modules.Example
Pitch
Currently there is now way to perform asynchronous operations in
createTransformer
which is needlessly restrictive. Indeed, it seems this would only require but minimal code changes because thecreateTransformer
is already called inside an asynchronous function.packages/jest-transform/src/ScriptTransformer.ts#L272
The text was updated successfully, but these errors were encountered: