refactor(ipc): validate write payloads in preload
This commit is contained in:
1 parent
3609456ca5
commit
227fd7faf2
9 files changed
+302
-35
No files matched your search
@@ -3,11 +3,12 @@ import { join } from "node:path";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
describe("preload bundling contract", () => {
|
||||
it("keeps Zod validation on the main-process IPC boundary", () => {
|
||||
it("delegates preload IPC validation through the shared forwarder registry", () => {
|
||||
const configSource = readFileSync(join(process.cwd(), "electron.vite.config.ts"), "utf8");
|
||||
const preloadSource = readFileSync(join(process.cwd(), "src/preload/index.ts"), "utf8");
|
||||
|
||||
expect(configSource).not.toContain('exclude: ["zod"]');
|
||||
expect(configSource).toContain('exclude: ["zod"]');
|
||||
expect(preloadSource).toContain("PRELOAD_INPUT_SCHEMAS");
|
||||
expect(preloadSource).not.toContain('from "@shared/contracts"');
|
||||
expect(preloadSource).not.toMatch(/from ["']zod["']|require\(["']zod["']\)/);
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user