mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-19 14:52:40 +08:00
9daf2c663c
* upgrade nodejs to 18.17.0 fix compile-native-ts fix type fix eslint fix node version on native-binding test native ci fix eslint fix jest version upgrade ts-jest fix reduce EXPECTED_CAPACITY update ccbuidl Revert "test native ci" This reverts commit 795c8c68cf7ff7f2561db4414689ad3f6aa5c1f7. # Conflicts: # scripts/native-pack-tool/package-lock.json * detect node version # Conflicts: # package.json * use engine-strict option * Update .nvmrc * Update pal/input/web/accelerometer-input.ts * fix conflict * fix compile native ts * download external in compile native ts * fix
33 lines
1.1 KiB
JavaScript
33 lines
1.1 KiB
JavaScript
const { pathsToModuleNameMapper } = require('ts-jest');
|
|
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: './tests/test-environment.ts',
|
|
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)/)',
|
|
'native/external/emscripten/',
|
|
],
|
|
setupFilesAfterEnv: [
|
|
"./tests/setup-after-env.ts",
|
|
"./tests/utils/log-capture-setup-after-env.ts"
|
|
],
|
|
setupFiles: [
|
|
'./tests/init.ts',
|
|
],
|
|
coverageDirectory: './test/report/',
|
|
globals: {
|
|
CC_DEV: true,
|
|
CC_TEST: true,
|
|
CC_PHYSICS_BUILTIN: true,
|
|
}
|
|
};
|