mirror of
https://github.com/flarum/framework.git
synced 2024-12-13 15:13:42 +08:00
e7fc29a59f
* feat(jest): create jest config package for unit testing * chore: housekeeping * fix: now we need to explicitly allow importing without extension * fix: recover EditorDriverInterface import * Apply suggestions from code review * chore: yarn Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
23 lines
501 B
JavaScript
23 lines
501 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.js'),
|
|
],
|
|
'^.+\\.tsx?$': [
|
|
'ts-jest',
|
|
{
|
|
useESM: true,
|
|
},
|
|
],
|
|
},
|
|
preset: 'ts-jest',
|
|
setupFilesAfterEnv: [path.resolve(__dirname, 'setup-env.js')],
|
|
moduleDirectories: ['node_modules', 'src'],
|
|
...options,
|
|
});
|