How to use the ts-jest.jestPreset.transform function in ts-jest

To help you get started, we’ve selected a few ts-jest examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github marp-team / marp-web / jest.config.js View on Github external
module.exports = {
  collectCoverageFrom: ['src/**/*.ts', 'src/**/*.tsx'],
  coveragePathIgnorePatterns: ['/node_modules/', '.*\\.d\\.ts'],
  coverageThreshold: { global: { lines: 95 } },
  globals: {
    'ts-jest': {
      tsConfig: {
        jsx: 'react',
        jsxFactory: 'h',
      },
    },
  },
  moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
  moduleNameMapper: { '\\.module\\.(c|sc|sa)ss$': 'identity-obj-proxy' },
  setupFiles: ['jest-plugin-context/setup'],
  transform: jestPreset.transform,
  testEnvironment: 'jsdom',
  testRegex: '(/(test|__tests__)/(?!_).*|(\\.|/)(test|spec))\\.[jt]sx?$',
}
github marp-team / marp-cli / jest.config.js View on Github external
const { jestPreset } = require('ts-jest')

module.exports = {
  collectCoverageFrom: ['src/**/*.ts'],
  coveragePathIgnorePatterns: ['/node_modules/', '.*\\.d\\.ts'],
  coverageThreshold: { global: { lines: 95 } },
  moduleFileExtensions: ['ts', 'js', 'json', 'node'],
  setupFiles: ['jest-plugin-context/setup', './jest.setup.js'],
  transform: {
    ...jestPreset.transform,
    '^.*\\.s?css$': '/test/_transformers/css.js',
    '^.*\\.png$': '/test/_transformers/png.js',
    '^.*\\.pug$': '/test/_transformers/pug.js',
  },
  testEnvironment: 'node',
  testRegex: '(/(test|__tests__)/(?!_).*|(\\.|/)(test|spec))\\.[jt]s$',
}