mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 13:26:44 +00:00
02559b61ba
* chore: run backend tests concurrently * fix: mock app server create database * chore: using @swc/jest instead of ts-jest * chore: create test database * chore: database distributor * fix: test collection manager * fix: test * chore: to use Jest.mock, change the formatter to the commonjs module * chore: db acquire * chore: github action * fix: pg test action * chore: formatter * chore: jest workaround * fix: mysql test * chore: mysql github action * chore: clean storage * chore: gitignore * chore: max workers
47 lines
1.1 KiB
JavaScript
47 lines
1.1 KiB
JavaScript
const { pathsToModuleNameMapper } = require('ts-jest');
|
|
const { compilerOptions } = require('./tsconfig.paths.json');
|
|
|
|
const swcrc = {
|
|
jsc: {
|
|
parser: {
|
|
syntax: 'typescript',
|
|
tsx: false,
|
|
decorators: true,
|
|
dynamicImport: false,
|
|
},
|
|
},
|
|
};
|
|
|
|
((swcrc.jsc ??= {}).experimental ??= {}).plugins = [['jest_workaround', {}]];
|
|
|
|
const config = {
|
|
rootDir: process.cwd(),
|
|
collectCoverage: false,
|
|
verbose: true,
|
|
preset: 'ts-jest',
|
|
testMatch: ['**/__tests__/**/*.test.[jt]s'],
|
|
setupFiles: ['./jest.setup.ts'],
|
|
setupFilesAfterEnv: ['./jest.setupAfterEnv.ts'],
|
|
moduleNameMapper: {
|
|
...pathsToModuleNameMapper(compilerOptions.paths, {
|
|
prefix: '<rootDir>/',
|
|
}),
|
|
},
|
|
transform: {
|
|
'^.+\\.(t|j)sx?$': ['@swc/jest', swcrc],
|
|
},
|
|
modulePathIgnorePatterns: ['/esm/', '/es/', '/dist/', '/lib/', '/client/', '/sdk/', '\\.test\\.tsx$'],
|
|
coveragePathIgnorePatterns: [
|
|
'/node_modules/',
|
|
'/__tests__/',
|
|
'/esm/',
|
|
'/lib/',
|
|
'package.json',
|
|
'/demo/',
|
|
'package-lock.json',
|
|
'/storage/',
|
|
],
|
|
};
|
|
|
|
module.exports = config;
|