The jest transformer that makes existing jest 'async' transformer, using such as processAsync, as a synchronous transformer. This enables to use async-only transformers in any places.
Install:
npm install -D jest-async-transformer-to-sync-transformer
const jestConfig = {
// ...
transform: {
'\\.[mc]?[j]sx?$': [
'jest-async-transformer-to-sync-transformer',
{ as: 'babel-jest' },
],
},
};Specifies options such as
'<regex>': ['jest-async-transformer-to-sync-transformer', <options>]
The base transformer to call.
Options to pass to the base transformer. Any options are passed to the transformer as-is, but options cannot have non-transferable values.