Move the western transit point left to clear the lamp with the largest NPC footprint. Document source-based frontend collision verification and allow Jest to run from a clean checkout without the optional local test directory.
34 lines
977 B
JavaScript
34 lines
977 B
JavaScript
const { existsSync } = require('node:fs');
|
|
const { join } = require('node:path');
|
|
|
|
module.exports = {
|
|
preset: 'ts-jest',
|
|
moduleFileExtensions: ['js', 'json', 'ts'],
|
|
// The optional local integration tests are not part of a clean checkout.
|
|
roots: ['<rootDir>/src', ...(existsSync(join(__dirname, 'test')) ? ['<rootDir>/test'] : [])],
|
|
testRegex: '.*\\.(spec|e2e-spec|integration-spec|perf-spec)\\.ts$',
|
|
transform: {
|
|
'^.+\\.ts$': 'ts-jest',
|
|
},
|
|
collectCoverageFrom: [
|
|
'**/*.(t|j)s',
|
|
],
|
|
coverageDirectory: '../coverage',
|
|
testEnvironment: 'node',
|
|
moduleNameMapper: {
|
|
'^src/(.*)$': '<rootDir>/src/$1',
|
|
},
|
|
// 添加异步处理配置
|
|
testTimeout: 10000,
|
|
// 强制退出以避免挂起
|
|
forceExit: true,
|
|
// 检测打开的句柄
|
|
detectOpenHandles: true,
|
|
// 处理 ES 模块
|
|
transformIgnorePatterns: [
|
|
'node_modules/(?!(@faker-js/faker)/)',
|
|
],
|
|
// 设置测试环境变量
|
|
setupFilesAfterEnv: ['<rootDir>/test-setup.js'],
|
|
};
|