test(@websnacksjs/i18n): fix broken tests missing translation messages (#5)

This commit is contained in:
M. George Hansen 2025-08-20 08:57:15 +12:00
parent 2867c2f875
commit d6696a150b
Signed by: mgeorgehansen
SSH key fingerprint: SHA256:JlIGiQLPyQ2RHTH3a2oVlb20Xkh9Glr8DUF4YTXHJxM
10 changed files with 35 additions and 65 deletions

View file

@ -2,8 +2,8 @@ import I18n, { type I18nOptions } from "@websnacksjs/i18n";
export type Fixtures = {
base: {
common: typeof import("./fixtures/base/messages/en/common.json");
drama: typeof import("./fixtures/base/messages/en/drama.json");
common: typeof import("./fixtures/base/en/common.json");
drama: typeof import("./fixtures/base/en/drama.json");
};
};
@ -17,7 +17,7 @@ export const withFixture = <F extends keyof Fixtures>(
supportedLocales: ["en", "fr", "fr-Arab"],
namespaces: ["drama"],
messagesUrlTemplate: new URL(
"./fixtures/base/messages/:locale/:namespace.json",
"./fixtures/base/:locale/:namespace.json",
import.meta.url,
),
...(overrides as Partial<I18nOptions<Fixtures["base"]>>),