2018-10-12 15:32:17 +02:00
|
|
|
module.exports = {
|
2021-08-24 14:52:45 +02:00
|
|
|
testMatch: ['**/*.test.js', '**/*.test.ts', '**/*.test.tsx'],
|
2021-09-13 14:36:25 +02:00
|
|
|
setupFilesAfterEnv: ['<rootDir>/jest-setup-after-env.ts'],
|
2018-10-12 15:32:17 +02:00
|
|
|
verbose: true,
|
|
|
|
rootDir: 'test',
|
|
|
|
modulePaths: ['<rootDir>/lib'],
|
2021-10-16 14:22:42 +02:00
|
|
|
transformIgnorePatterns: ['/node_modules/', '/next[/\\\\]dist/', '/.next/'],
|
2021-08-23 20:36:56 +02:00
|
|
|
transform: {
|
|
|
|
'.+\\.(t|j)sx?$': [
|
|
|
|
// this matches our SWC options used in https://github.com/vercel/next.js/blob/canary/packages/next/taskfile-swc.js
|
|
|
|
'@swc/jest',
|
|
|
|
{
|
2021-09-13 14:36:25 +02:00
|
|
|
sourceMaps: 'inline',
|
2021-08-23 20:36:56 +02:00
|
|
|
module: {
|
|
|
|
type: 'commonjs',
|
|
|
|
},
|
|
|
|
env: {
|
|
|
|
targets: {
|
|
|
|
node: '12.0.0',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
jsc: {
|
|
|
|
loose: true,
|
|
|
|
|
|
|
|
parser: {
|
|
|
|
syntax: 'typescript',
|
|
|
|
dynamicImport: true,
|
|
|
|
tsx: true,
|
|
|
|
},
|
|
|
|
transform: {
|
|
|
|
react: {
|
|
|
|
pragma: 'React.createElement',
|
|
|
|
pragmaFrag: 'React.Fragment',
|
|
|
|
throwIfNamespace: true,
|
|
|
|
development: false,
|
|
|
|
useBuiltins: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
2018-10-12 15:32:17 +02:00
|
|
|
}
|