jest-chain-transform
Support for multiple transform scripts of jest
Last updated 3 years ago by anc95 .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install jest-chain-transform 
SYNC missed versions from official npm registry.

jest-chain-transform

Node.js Package Node.js CI

jest-chain-transform enables jest can transform file by mutiple transformers.

install

npm

npm install jest-chain-transform -D

yarn

yarn add jest-chain-transform -D

config

// jest.config.js
module.exports = {
  transform: {
    "\\.[jt]sx?$": [
      'jest-chain-transform',
      {
        transformers: [
          'path-of-your-custom-transformer', 'ts-jest'
        ]
      }
    ]
  },
}

Jest will transform all files that match \\.[jt]sx?$ by path-of-your-custom-transformer and 'ts-jest' in turn.

If you need to pass extra option to transform, you can write config as follow

// jest.config.js
module.exports = {
  transform: {
    "\\.[jt]sx?$": [
      'jest-chain-transform',
      {
        transformers: [
          ['path-of-your-custom-transformer', { ... }],
          ['babel-jest', { ... }]
        ]
      }
    ]
  },
}

option

interface Config {
  /**
   * multiple transforms
   * @example
   * ```js
   * ['babel-jest', 'ts-jest']
   * [
   *   ['babel-jest', { }],
   *   ['ts-jest', { }]
   * ]
   * ```
   */
  transformers: string[] | [string, Record<string, any>][];
}

Current Tags

  • 0.0.5                                ...           latest (3 years ago)

6 Versions

  • 0.0.5                                ...           3 years ago
  • 0.0.4                                ...           5 years ago
  • 0.0.4-alpha.2                                ...           5 years ago
  • 0.0.3                                ...           5 years ago
  • 0.0.1                                ...           5 years ago
  • 0.0.2                                ...           5 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 2
Dependencies (0)
None
Dev Dependencies (5)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |