From a59f6ef543e794410d02d4a6cd6adbecfafa224e Mon Sep 17 00:00:00 2001 From: Samuel Stroschein <35429197+samuelstroschein@users.noreply.github.com> Date: Sat, 7 Sep 2024 13:40:43 -0400 Subject: [PATCH] test: add missing argument --- .../project/loadProjectFromDirectory.test.ts | 28 +++++++++---------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/inlang/source-code/sdk2/src/project/loadProjectFromDirectory.test.ts b/inlang/source-code/sdk2/src/project/loadProjectFromDirectory.test.ts index 32ae5a5753..3403d259e9 100644 --- a/inlang/source-code/sdk2/src/project/loadProjectFromDirectory.test.ts +++ b/inlang/source-code/sdk2/src/project/loadProjectFromDirectory.test.ts @@ -275,19 +275,17 @@ test("plugin calls that use fs should be intercepted to use an absolute path", a process.cwd = () => "/"; const mockRepo = { - "/inlang/development-projects/inlang-nextjs/app/i18n/locales/en.json": - JSON.stringify({ - key1: "value1", - key2: "value2", - }), - "/inlang/development-projects/inlang-nextjs/other-folder/backend.inlang/settings.json": - JSON.stringify({ - baseLocale: "en", - locales: ["en", "de"], - "plugin.mock-plugin": { - pathPattern: "./../../app/i18n/locales/{locale}.json", - }, - } satisfies ProjectSettings), + "/messages/en.json": JSON.stringify({ + key1: "value1", + key2: "value2", + }), + "/project.inlang/settings.json": JSON.stringify({ + baseLocale: "en", + locales: ["en", "de"], + "plugin.mock-plugin": { + pathPattern: "./messages/{locale}.json", + }, + } satisfies ProjectSettings), }; const mockPlugin: InlangPlugin = { @@ -348,12 +346,12 @@ test("plugin calls that use fs should be intercepted to use an absolute path", a const project = await loadProjectFromDirectoryInMemory({ fs: fs as any, - path: "/inlang/development-projects/inlang-nextjs/other-folder/backend.inlang", + path: "/project.inlang", providePlugins: [mockPlugin], }); expect(loadMessagesSpy).toHaveBeenCalled(); - expect(fsReadFileSpy).toHaveBeenCalledWith("/messages/en.json"); + expect(fsReadFileSpy).toHaveBeenCalledWith("/messages/en.json", undefined); // todo test that saveMessages works too. // await project.db.insertInto("bundle").defaultValues().execute();