mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-03-13 05:15:17 +00:00
- remove any `.js` extension imports - remove unncessary dynamic imports of `modifier.ts` file. The file was being imported statically & dynamically. Made it pure static - increase vite chunk-size warning limit Co-authored-by: Mumble <171087428+frutescens@users.noreply.github.com>
28 lines
816 B
TypeScript
28 lines
816 B
TypeScript
import { Moves } from "#app/enums/moves";
|
|
import i18next, { type ParseKeys } from "i18next";
|
|
import { vi } from "vitest";
|
|
|
|
/** Ready to use array of Moves.SPLASH x4 */
|
|
export const SPLASH_ONLY = [Moves.SPLASH, Moves.SPLASH, Moves.SPLASH, Moves.SPLASH];
|
|
|
|
/**
|
|
* Sets up the i18next mock.
|
|
* Includes a i18next.t mocked implementation only returning the raw key (`(key) => key`)
|
|
*
|
|
* @returns A spy/mock of i18next
|
|
*/
|
|
export function mockI18next() {
|
|
return vi.spyOn(i18next, "t").mockImplementation((key: ParseKeys) => key);
|
|
}
|
|
|
|
/**
|
|
* Creates an array of range `start - end`
|
|
*
|
|
* @param start start number e.g. 1
|
|
* @param end end number e.g. 10
|
|
* @returns an array of numbers
|
|
*/
|
|
export function arrayOfRange(start: integer, end: integer) {
|
|
return Array.from({ length: end - start }, (_v, k) => k + start);
|
|
}
|