framework/js-packages/jest-config/index.cjs
Sami Mazouz 016503d8c3
feat: export registry (#3842)
* feat: registry first iteration

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

* feat: improve webpack auto export loader

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

* chore: remove `compat` API

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

* chore: cleanup

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

---------

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-06-29 18:57:53 +01:00

23 lines
502 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',
setupFilesAfterEnv: [path.resolve(__dirname, 'setup-env.js')],
moduleDirectories: ['node_modules', 'src'],
...options,
});