How to use the ts-jest/presets.jsWithTs.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 graphql / graphiql / jest.config.js View on Github external
},
  clearMocks: true,
  collectCoverage: true,
  setupFiles: [path.join(__dirname, '/resources/enzyme.config.js')],
  testMatch: [
    '/packages/*/src/**/*-test.{js,ts}',
    '/packages/*/src/**/*.spec.{js,ts}',
  ],
  moduleNameMapper: {
    '\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
      'identity-obj-proxy',
    '\\.(css|less)$': 'identity-obj-proxy',
  },
  transform: {
    '^.+\\.jsx?$': require.resolve('./resources/jestBabelTransform'),
    ...tsjPreset.transform,
    ...jsWithBabelPreset.transform,
  },
  testEnvironment: require.resolve('jest-environment-jsdom-global'),
  testPathIgnorePatterns: ['node_modules', 'dist', 'codemirror-graphql'],
  collectCoverageFrom: [
    '**/src/**/*.{js,jsx,ts,tsx}',
    '!**/src/**/*.stories.js*',
    '!**/new-components/theme/default.js*',
    '!**/new-components/**', // TODO: add proper coverage to new components
    '!**/{dist,esm}/**',
    '!**/node_modules/**',
    '!**/__tests__/**',
    '!**/resources/**',
    '!**/examples/**',
    '!**/codemirror-graphql/**',
  ],
github NervJS / taro / jest.config.js View on Github external
// eslint-disable-next-line @typescript-eslint/no-var-requires
const { jsWithTs: tsjPreset } = require('ts-jest/presets')
const path = require('path')

module.exports = {
  testEnvironment: 'node',
  transform: {
    ...tsjPreset.transform
  },
  testURL: 'http://localhost/',
  moduleFileExtensions: [
    'ts',
    'tsx',
    'js',
    'jsx',
    'json',
    'node'
  ],
  globals: {
    'ts-jest': {
      diagnostics: false,
      tsConfig: {
        jsx: 'react',
        allowJs: true,
github NervJS / taro / packages / taro-runtime / jest.config.js View on Github external
// eslint-disable-next-line @typescript-eslint/no-var-requires
const { jsWithTs: tsjPreset } = require('ts-jest/presets')
const path = require('path')

module.exports = {
  testEnvironment: 'node',
  transform: {
    ...tsjPreset.transform
  },
  testURL: 'http://localhost/',
  moduleFileExtensions: [
    'ts',
    'tsx',
    'js',
    'jsx',
    'json',
    'node'
  ],
  globals: {
    'ts-jest': {
      diagnostics: false,
      tsConfig: {
        jsx: 'react',
        allowJs: true,
github NervJS / taro / packages / taro-components / stencil.config.ts View on Github external
export const config: Config = {
  namespace: 'taro-components',
  globalStyle: './node_modules/weui/dist/style/weui.css',
  plugins: [
    sass()
  ],
  outputTargets: [
    {
      type: 'dist'
    }
  ],
  excludeSrc: ['/test/', '**/.spec.', '/types/', '*.d.ts'],
  testing: {
    testRegex: '(/__tests__/.*|(\\.|/)(tt|spec))\\.[jt]sx?$',
    transform: {
      ...tsjPreset.transform
    },
    globals: {
      'ts-jest': {
        diagnostics: false,
        tsConfig: {
          jsx: 'react',
          allowJs: true,
          target: 'ES6'
        }
      }
    },
    emulate: [{
      device: 'iPhone 8'
    }]
  }
}
github merceyz / babel-plugin-optimize-clsx / jest.config.js View on Github external
const { jsWithTs } = require('ts-jest/presets');
const path = require('path');

module.exports = {
  clearMocks: true,
  testEnvironment: 'node',
  testRegex: `test/index.js`,
  transform: jsWithTs.transform,
  globals: {
    'ts-jest': {
      packageJson: path.join(__dirname, 'package.json'),
    },
  },
};
github NervJS / taro / packages / taro-with-weapp / jest.config.js View on Github external
const { jsWithTs: tsjPreset } = require('ts-jest/presets')

module.exports = {
  testEnvironment: 'jsdom',
  transform: {
    ...tsjPreset.transform
  },
  testURL: 'http://localhost/',
  moduleFileExtensions: [
    'ts',
    'tsx',
    'js',
    'jsx',
    'json',
    'node'
  ],
  globals: {
    'ts-jest': {
      diagnostics: false,
      tsConfig: {
        jsx: 'react',
        allowJs: true,