mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2024-11-26 16:56:11 +00:00
tests: add mock for FontFace and it to vitest setup (#1591)
This commit is contained in:
parent
6c5e7884df
commit
48f2ecf39a
17
src/test/fontFace.setup.ts
Normal file
17
src/test/fontFace.setup.ts
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
class FontFaceMock {
|
||||||
|
family: string;
|
||||||
|
source: string;
|
||||||
|
descriptors: any;
|
||||||
|
|
||||||
|
constructor(family: string, source: string, descriptors?: any) {
|
||||||
|
this.family = family;
|
||||||
|
this.source = source;
|
||||||
|
this.descriptors = descriptors;
|
||||||
|
}
|
||||||
|
|
||||||
|
load(): Promise<FontFaceMock> {
|
||||||
|
return Promise.resolve(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
globalThis.FontFace = FontFaceMock as any;
|
@ -1,5 +1,6 @@
|
|||||||
import "vitest-canvas-mock";
|
import "vitest-canvas-mock";
|
||||||
import "#app/test/phaser.setup";
|
import "#app/test/phaser.setup";
|
||||||
|
import "#app/test/fontFace.setup";
|
||||||
import {initStatsKeys} from "#app/ui/game-stats-ui-handler";
|
import {initStatsKeys} from "#app/ui/game-stats-ui-handler";
|
||||||
import {initPokemonPrevolutions} from "#app/data/pokemon-evolutions";
|
import {initPokemonPrevolutions} from "#app/data/pokemon-evolutions";
|
||||||
import {initBiomes} from "#app/data/biomes";
|
import {initBiomes} from "#app/data/biomes";
|
||||||
|
Loading…
Reference in New Issue
Block a user