Skip to content

jet2jet/jest-async-transformer-to-sync-transformer

Repository files navigation

jest-async-transformer-to-sync-transformer

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.

Usage

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' },
    ],
  },
};

Transformer options

Specifies options such as '<regex>': ['jest-async-transformer-to-sync-transformer', <options>]

as: string (Required)

The base transformer to call.

options?: Record<string, unknown>

Options to pass to the base transformer. Any options are passed to the transformer as-is, but options cannot have non-transferable values.

License

MIT License

About

jest transformer wrapper for wrapping async transformer as sync transformer

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors