修复ci测试
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
module.exports = {
|
||||
preset: 'ts-jest',
|
||||
testEnvironment: 'node',
|
||||
roots: ['<rootDir>/tests', '<rootDir>/src'],
|
||||
roots: ['<rootDir>/tests'],
|
||||
testMatch: ['**/*.test.ts', '**/*.spec.ts'],
|
||||
testPathIgnorePatterns: ['/node_modules/', '\\.performance\\.test\\.ts$'],
|
||||
collectCoverage: false,
|
||||
@@ -43,11 +43,13 @@ module.exports = {
|
||||
transform: {
|
||||
'^.+\\.tsx?$': ['ts-jest', {
|
||||
tsconfig: 'tsconfig.json',
|
||||
useESM: false,
|
||||
}],
|
||||
},
|
||||
moduleNameMapper: {
|
||||
'^@/(.*)$': '<rootDir>/src/$1',
|
||||
},
|
||||
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
|
||||
setupFilesAfterEnv: ['<rootDir>/tests/setup.ts'],
|
||||
// 测试超时设置
|
||||
testTimeout: 10000,
|
||||
|
||||
@@ -117,7 +117,7 @@ describe('Core - 核心管理系统测试', () => {
|
||||
test('在未创建实例时调用update应该显示警告', () => {
|
||||
Core.update(0.016);
|
||||
|
||||
expect(console.warn).toHaveBeenCalledWith("Core实例未创建,请先调用Core.create()");
|
||||
expect(console.warn).toHaveBeenCalledWith(expect.stringContaining("Core实例未创建,请先调用Core.create()"));
|
||||
});
|
||||
});
|
||||
|
||||
@@ -389,7 +389,7 @@ describe('Core - 核心管理系统测试', () => {
|
||||
|
||||
Core.enableDebug(debugConfig);
|
||||
|
||||
expect(console.warn).toHaveBeenCalledWith("Core实例未创建,请先调用Core.create()");
|
||||
expect(console.warn).toHaveBeenCalledWith(expect.stringContaining("Core实例未创建,请先调用Core.create()"));
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -173,7 +173,7 @@ describe('EventBus - 事件总线测试', () => {
|
||||
});
|
||||
|
||||
test('应该能够设置调试模式', () => {
|
||||
const consoleSpy = jest.spyOn(console, 'log').mockImplementation(() => {});
|
||||
const consoleSpy = jest.spyOn(console, 'info').mockImplementation(() => {});
|
||||
|
||||
eventBus.setDebugMode(true);
|
||||
eventBus.on('debug:event', () => {});
|
||||
|
||||
Reference in New Issue
Block a user