Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const { defaults } = require('jest-config');
module.exports = {
setupFiles: ['./jest.setup.ts'],
coveragePathIgnorePatterns: [...defaults.coveragePathIgnorePatterns, './jest.setup.ts'],
preset: 'ts-jest',
globals: {
'ts-jest': {
// See https://github.com/kulshekhar/ts-jest/issues/748#issuecomment-423528659
//
// Ignore ts-jest error (false positive):
// "message TS151001: If you have issues related to imports, you should consider setting `esModuleInterop` to `true` in your TypeScript configuration file (usually `tsconfig.json`).
// See https://blogs.msdn.microsoft.com/typescript/2018/01/31/announcing-typescript-2-7/#easier-ecmascript-module-interoperability for more information."
diagnostics: {
ignoreCodes: [151001]
}
}
}
};
const { defaults } = require('jest-config');
module.exports = {
// rootDir: './',
transform: {
...defaults.transform,
'^.+\\.[t|j]sx?$': '/jest.transform.js',
},
moduleFileExtensions: [
'js',
'jsx',
],
testEnvironment: 'node',
coveragePathIgnorePatterns: [].concat(
defaults.coveragePathIgnorePatterns,
[]
),
setupFiles: [
'/jest.init.js',
],
verbose: true,
};
const path = require('path')
module.exports = {
rootDir: path.join(__dirname, '..'),
testURL: 'http://localhost/',
globals: {
'ts-jest': {
extends: path.join(__dirname, '..', 'babel.config.js'),
},
},
transform: {
'^.+\\.(ts|tsx)$': 'ts-jest',
},
moduleFileExtensions: ['ts', 'tsx', 'js'],
coveragePathIgnorePatterns: [
...defaults.coveragePathIgnorePatterns,
'.stories.tsx',
'.d.ts',
'./packages/styled/src/index.ts',
'./packages/hooks/src/index.ts',
],
// coveragePathIgnorePatterns: ['**/**/*.d.ts', '**/**/*.test.+(ts|tsx|js)', '++/**/*.stories.+(ts|tsx)'],
snapshotSerializers: ['jest-serializer-html'],
watchPlugins: [
'jest-watch-typeahead/filename',
'jest-watch-typeahead/testname',
'jest-watch-select-projects',
'jest-runner-eslint/watch-fix',
],
}
const path = require('path');
const {defaults} = require('jest-config');
module.exports = {
moduleFileExtensions: [...defaults.moduleFileExtensions],
testEnvironment: 'node',
collectCoverage: true,
coverageDirectory: path.join(__dirname, 'coverage'),
coverageReporters: [...defaults.coverageReporters, 'html'],
coveragePathIgnorePatterns: [...defaults.coveragePathIgnorePatterns, 'samples/'],
transform: {},
collectCoverageFrom: [
'**/*.{js}',
'!**/node_modules/**',
'!**/samples/**',
'!**/coverage/**',
'!jest.*'
]
};