Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
/* 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',
],
};
/* 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',
],
};
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/**',
],
};
/* 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',
],
};
/* 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',
],
};
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',
],
};
},
},
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',
],
}
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',
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'