Files
cocos4/tests/init.ts
T
Leslie Leigh (李的序) a3207d6bcb Suppress no-initializer warns if the property is declared to have object type (#7917)
* Suppress no-initializer warns if the property is declared to have object type

* Use 'default' in

* Update

* Revert

* Revert

* Update
2020-12-15 17:23:41 +08:00

34 lines
755 B
TypeScript

jest.mock(
'internal:constants',
() => jest.requireActual('../cocos/core/default-constants'),
{ virtual: true, },
);
jest.mock('../cocos/core/platform/debug', () => {
const result = {
__esModule: true, // Use it when dealing with esModules
...jest.requireActual('../cocos/core/platform/debug'),
};
if (result.warnID) {
result.warnID = jest.fn();
}
return result;
});
import '../exports/base';
import { DebugMode } from "../cocos/core/platform/debug";
cc.game._initConfig({
debugMode: DebugMode.INFO,
});
// cc.game.init({
// debugMode: DebugMode.INFO,
// adapter: {
// canvas: document.createElement('canvas'),
// frame: {},
// container: {}
// }
// });