Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/monkey-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ jobs:
- 'frontend/static/**/*'
- '**/*.{scss,css}'
be-src:
- 'backend/**/*.{ts,js,json,lua,css,html}'
- 'backend/**/*'
- 'backend/package.json'
fe-src:
- 'frontend/**/*.{ts,scss,html}'
- 'frontend/**/*.{ts,tsx,js,scss,html}'
- 'frontend/**/package.json'
pkg-src:
- 'packages/**/*'
Expand Down
4 changes: 2 additions & 2 deletions backend/__tests__/api/controllers/preset.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ describe("PresetController", () => {
});
expect(addPresetMock).not.toHaveBeenCalled();
});
it("should not fail with emtpy config", async () => {
it("should not fail with empty config", async () => {
//GIVEN

addPresetMock.mockResolvedValue({ presetId: "1" });
Expand Down Expand Up @@ -357,7 +357,7 @@ describe("PresetController", () => {
},
});
});
it("should not fail with emtpy config", async () => {
it("should not fail with empty config", async () => {
//GIVEN

editPresetMock.mockResolvedValue({} as any);
Expand Down
22 changes: 22 additions & 0 deletions frontend/__tests__/__harness__/mock-static.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { readFileSync } from "fs";
import { resolve } from "path";
import { fileURLToPath } from "url";
import { vi } from "vitest";

const BASE_DIR = resolve(fileURLToPath(import.meta.url), "../../../static");

async function readJson<T>(filePath: string): Promise<T> {
const fullPath = resolve(BASE_DIR, filePath.replace(/^\//, ""));
const data = readFileSync(fullPath, "utf-8");
return JSON.parse(data) as T;
}

vi.mock("../../src/ts/utils/json-data", async (importOriginal) => {
const original = (await importOriginal()) as any;

// oxlint-disable-next-line typescript/no-unsafe-return
return {
...original,
getLayout: async (name: string) => readJson(`/layouts/${name}.json`),
};
});
Loading
Loading