Files
cocos4/tests/core/gfx/device-manager.test.ts
T
minggo c5c7b987ea move cocos/core/gfx to cocos/gfx (#12559)
* move cocos/core/gfx to cocos/gfx
2022-08-26 17:51:46 +08:00

22 lines
873 B
TypeScript

import { deviceManager, RenderType } from "../../../cocos/gfx"
test('determineRenderType', () => {
// @ts-expect-error
let renderType = deviceManager._determineRenderType(-1);
expect(renderType).toBe(RenderType.WEBGL);
// @ts-expect-error
renderType = deviceManager._determineRenderType(0);
expect(renderType).toBe(RenderType.WEBGL);
// @ts-expect-error
renderType = deviceManager._determineRenderType(1);
expect(renderType).toBe(RenderType.CANVAS);
// @ts-expect-error
renderType = deviceManager._determineRenderType(2);
expect(renderType).toBe(RenderType.WEBGL);
// @ts-expect-error
renderType = deviceManager._determineRenderType(3);
expect(renderType).toBe(RenderType.HEADLESS);
// @ts-expect-error
renderType = deviceManager._determineRenderType(4);
expect(renderType).toBe(RenderType.WEBGL);
})