mirror of
https://github.com/flarum/framework.git
synced 2024-11-29 04:33:47 +08:00
21 lines
541 B
JavaScript
21 lines
541 B
JavaScript
const path = require('path');
|
|
|
|
module.exports = (options = {}) => ({
|
|
testEnvironment: 'jsdom',
|
|
extensionsToTreatAsEsm: ['.ts', '.tsx'],
|
|
transform: {
|
|
'^.+\\.[tj]sx?$': ['babel-jest', require('flarum-webpack-config/babel.config.cjs')],
|
|
'^.+\\.tsx?$': [
|
|
'ts-jest',
|
|
{
|
|
useESM: true,
|
|
},
|
|
],
|
|
},
|
|
preset: 'ts-jest',
|
|
setupFiles: [path.resolve(__dirname, 'pollyfills.js')],
|
|
setupFilesAfterEnv: [path.resolve(__dirname, 'setup-env.js')],
|
|
moduleDirectories: ['node_modules', 'src'],
|
|
...options,
|
|
});
|