mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-21 16:12:40 +08:00
910c6233cb
* move dragonbones lib files to npm * mend * update package-lock.json * Fix CI Co-authored-by: SB <leslieleigh@outlook.com>
27 lines
918 B
JavaScript
27 lines
918 B
JavaScript
const { pathsToModuleNameMapper } = require('ts-jest/utils');
|
|
const ts = require('typescript');
|
|
const ps = require('path');
|
|
const tsConfig = ts.readConfigFile(ps.join(__dirname, 'tsconfig.json'), ts.sys.readFile);
|
|
if (!tsConfig.config) {
|
|
throw new Error(`Failed to read tsconfig`);
|
|
}
|
|
const { compilerOptions } = tsConfig.config;
|
|
module.exports = {
|
|
testEnvironment: 'jsdom',
|
|
testRegex: '/tests/.*\\.(test|spec)?\\.(ts|tsx)$',
|
|
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths, { prefix: `${__dirname}/` }),
|
|
transformIgnorePatterns: [
|
|
// ignore everything in the node_modules EXCEPT for:
|
|
// - @cocos/dragonbones-js
|
|
'node_modules/(?!(@cocos/dragonbones-js)/)',
|
|
],
|
|
setupFiles: [
|
|
'./tests/init.ts',
|
|
],
|
|
coverageDirectory: './test/report/',
|
|
globals: {
|
|
CC_DEV: true,
|
|
CC_TEST: true,
|
|
CC_PHYSICS_BUILTIN: true,
|
|
}
|
|
}; |