How to use the ts-jest/presets.jsWithBabel.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 byCedric / use-expo / packages / permissions / jest.config.js View on Github external
/* eslint-disable @typescript-eslint/no-var-requires */
const jestExpoPreset = require('jest-expo/jest-preset');
const { jsWithBabel: tsJestPreset } = require('ts-jest/presets');

module.exports = {
	...jestExpoPreset,
	clearMocks: true,
	transform: {
		...tsJestPreset.transform,
		...jestExpoPreset.transform,
	},
	testMatch: [
		'**/*.test.ts',
	],
};
github byCedric / use-expo / jest.config.js View on Github external
/* eslint-disable @typescript-eslint/no-var-requires */
const jestExpoPreset = require('jest-expo/jest-preset');
const { jsWithBabel: tsJestPreset } = require('ts-jest/presets');

module.exports = {
	...jestExpoPreset,
	clearMocks: true,
	transform: {
		...tsJestPreset.transform,
		...jestExpoPreset.transform,
	},
	testMatch: [
		'/packages/**/*.test.ts',
	],
	modulePathIgnorePatterns: [
		'/example',
	],
};
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 byCedric / use-expo / packages / font / jest.config.js View on Github external
/* eslint-disable @typescript-eslint/no-var-requires */
const jestExpoPreset = require('jest-expo/jest-preset');
const { jsWithBabel: tsJestPreset } = require('ts-jest/presets');

module.exports = {
	...jestExpoPreset,
	clearMocks: true,
	transform: {
		...tsJestPreset.transform,
		...jestExpoPreset.transform,
	},
	testMatch: [
		'**/*.test.ts',
	],
};
github byCedric / use-expo / packages / screen-orientation / jest.config.js View on Github external
/* eslint-disable @typescript-eslint/no-var-requires */
const jestExpoPreset = require('jest-expo/jest-preset');
const { jsWithBabel: tsJestPreset } = require('ts-jest/presets');

module.exports = {
	...jestExpoPreset,
	clearMocks: true,
	transform: {
		...tsJestPreset.transform,
		...jestExpoPreset.transform,
	},
	testMatch: [
		'**/*.test.ts',
	],
};
github byCedric / use-expo / packages / sensors / jest.config.js View on Github external
const jestExpoPreset = require('jest-expo/jest-preset');
const { jsWithBabel: tsJestPreset } = require('ts-jest/presets');

module.exports = {
    ...jestExpoPreset,
    clearMocks: true,
    transform: {
		...tsJestPreset.transform,
		...jestExpoPreset.transform,
	},
	testMatch: [
		'**/*.test.ts',
	],
};
github helpscout / hsds-react / jest.config.js View on Github external
},
  },
  setupFiles: [
    '/config/polyfills.js',
    '/config/jsdomPolyfills.js',
  ],
  setupFilesAfterEnv: ['/config/jest/setupTests.js'],
  testMatch: [
    '/src/**/__tests__/**/*.test.(js|jsx|ts|tsx)',
    '/src/**/?(*.)(spec|test).js?(x)',
    '/src/**/?(*.)(spec|test).ts?(x)',
  ],
  testEnvironment: 'node',
  testURL: 'http://localhost',
  transform: {
    ...tsjPreset.transform,
    '^.+\\.css$': '/config/jest/cssTransform.js',
    '^(?!.*\\.(js|jsx|ts|tsx|css|json)$)':
      '/config/jest/fileTransform.js',
  },
  transformIgnorePatterns: ['[/\\\\]node_modules[/\\\\].+\\.(js|jsx|ts|tsx)$'],
  moduleFileExtensions: ['web.js', 'js', 'json', 'web.jsx', 'jsx', 'ts', 'tsx'],
  watchPlugins: [
    'jest-watch-typeahead/filename',
    'jest-watch-typeahead/testname',
  ],
}
github MacKentoch / react-bootstrap-webpack-starter / front / jest.config.js View on Github external
const { jsWithBabel: tsjPreset } = require('ts-jest/presets');

module.exports = {
  preset: 'ts-jest',
  transform: { ...tsjPreset.transform },
  testRegex: '(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$',
  moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
  globals: {
    'ts-jest': {
      tsConfig: './tsconfig.json',
      babelConfig: false,
    },
  },
  testEnvironment: 'node',
  verbose: true,
  roots: ['/src/', '/test'],
  setupFiles: [],
  setupFilesAfterEnv: ['/test/setupTests.ts'],
  moduleNameMapper: {
    '\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
      '/src/test/__mocks__/fileMock.js',
github ionic-team / ionic-native-google-maps / jest.config.js View on Github external
const { jsWithBabel: jestPreset } = require('ts-jest/presets');

module.exports = {
  transform: {
    ...jestPreset.transform,
  },
  testRegex: '(/__tests__/.*|(\\.|/)(test|spec))\\.(js?|ts?)$',
  moduleFileExtensions: [
    'ts',
    'tsx',
    'js',
    'jsx',
    'json',
  ],
  moduleNameMapper: {
    '^@ionic-native/core$': '/node_modules/@ionic-native/core',
    '^cordova/utils$': '/node_modules/cordova-js/src/common/utils',
    'rxjs': '/node_modules/rxjs',
  },
  setupFilesAfterEnv: [
    '/src/test/setupJest.js'