mirror of
https://github.com/Quad4-Software/MeshChatX.git
synced 2026-08-18 09:49:09 -04:00
16 lines
660 B
JavaScript
16 lines
660 B
JavaScript
import fs from "fs";
|
|
import path from "path";
|
|
import { fileURLToPath } from "url";
|
|
import { describe, expect, it } from "vitest";
|
|
|
|
const repoRoot = path.join(path.dirname(fileURLToPath(import.meta.url)), "..", "..");
|
|
const bundlePath = path.join(repoRoot, "electron/preload.bundle.js");
|
|
|
|
describe("electron/preload.bundle", () => {
|
|
it("exists and inlines shellOrigin for sandbox preload", () => {
|
|
expect(fs.existsSync(bundlePath)).toBe(true);
|
|
const source = fs.readFileSync(bundlePath, "utf8");
|
|
expect(source).toContain("function isTrustedShellOrigin");
|
|
expect(source).not.toContain('require("./shellOrigin")');
|
|
});
|
|
});
|