axios-hooks/jest.config.js
Mark Hebden b222e633f5
feat: update to support axios 1.x (#1418)
* feat: update to support axios 1.x

Updated the following packages too:
 - LRUCache
 - jest
 - ts-jest
 - prettier
 - typescript

* feat: migrate from legacy cancel token to abort controller

* chore: update axios peer dependency

---------

Co-authored-by: Mark Hebden <mark.hebden@airelogic.com>
2023-09-13 21:47:50 +02:00

34 lines
715 B
JavaScript

const commonOptions = {
resetMocks: true,
coverageDirectory: 'coverage'
}
const projects = [
{
displayName: 'js',
testMatch: ['**/?(*.)+(spec|test).js?(x)'],
testEnvironment: 'jsdom'
},
{
displayName: 'ts',
testMatch: ['**/?(*.)+(spec|test).ts?(x)'],
preset: 'ts-jest/presets/js-with-ts',
testEnvironment: 'jsdom'
},
{
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 }))
}