axios-hooks/jest.config.js
2019-11-30 22:48:26 +01:00

32 lines
655 B
JavaScript

const commonOptions = {
resetMocks: true,
coverageDirectory: 'coverage'
}
const projects = [
{
displayName: 'js',
testMatch: ['**/?(*.)+(spec|test).js?(x)']
},
{
displayName: 'ts',
testMatch: ['**/?(*.)+(spec|test).ts?(x)'],
preset: 'ts-jest/presets/js-with-ts'
},
{
displayName: 'ssr-js',
testMatch: ['**/?(*.)+(spec|test).ssr.js?(x)'],
testEnvironment: 'node'
},
{
displayName: 'ssr-ts',
testMatch: ['**/?(*.)+(spec|test).ssr.ts?(x)'],
preset: 'ts-jest/presets/js-with-ts',
testEnvironment: 'node'
}
]
module.exports = {
projects: projects.map(p => ({ ...p, ...commonOptions }))
}