Files
cocos4/tests/init.ts
T
PP 86f20da0f0 support pal/input (#8472)
* support pal/input

update

* update

* fix esLint

* support minigame

* support  pal/input on  minigame

* remove minigame.isSubContext

* support native

update

* deprecate static property on EventMouse

* deprecated static property in  EventTouch

* remove TODO

* remove  x y position in MouseWheel Event

* remove TODO

* remove temp code

* fix esLint

* update AccelerometerIntervalMode

* remove legacy code in JSB

* fix esLint

* optimize AccelerometerInputSource.setInterval

* fix esLint

* optimize code

* add more details for documentation

* update

* don't pass game.canvas to inputManager.registerSystemEvent

* optimize

* Revert "remove  x y position in MouseWheel Event"

This reverts commit b521ec4948d693b420887cdeb2f5f3afc1500066.

# Conflicts:
#	@types/pal/input.d.ts

* update

* fix esLint

* fix esLint
2021-04-19 16:24:42 +08:00

58 lines
1.2 KiB
TypeScript

jest.mock(
'internal:constants',
() => jest.requireActual('../cocos/core/default-constants'),
{ virtual: true, },
);
jest.mock(
'pal/audio',
() => jest.requireActual('../pal/audio/web/player'),
{ virtual: true, },
);
jest.mock(
'pal/minigame',
() => jest.requireActual('../pal/minigame/non-minigame'),
{ virtual: true, },
);
jest.mock(
'pal/system',
() => jest.requireActual('../pal/system/web/system'),
{ virtual: true, },
);
jest.mock(
'pal/input',
() => jest.requireActual('../pal/input/web/index'),
{ 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: {}
// }
// });