mirror of
https://github.com/moltbot/moltbot.git
synced 2026-04-24 07:01:49 +00:00
30 lines
1021 B
TypeScript
30 lines
1021 B
TypeScript
import { readFileSync } from "node:fs";
|
|
import { resolve } from "node:path";
|
|
import { describe, expect, it } from "vitest";
|
|
|
|
type ExtensionManifest = {
|
|
background?: { service_worker?: string; type?: string };
|
|
permissions?: string[];
|
|
};
|
|
|
|
function readManifest(): ExtensionManifest {
|
|
const path = resolve(process.cwd(), "assets/chrome-extension/manifest.json");
|
|
return JSON.parse(readFileSync(path, "utf8")) as ExtensionManifest;
|
|
}
|
|
|
|
describe("chrome extension manifest", () => {
|
|
it("keeps background worker configured as module", () => {
|
|
const manifest = readManifest();
|
|
expect(manifest.background?.service_worker).toBe("background.js");
|
|
expect(manifest.background?.type).toBe("module");
|
|
});
|
|
|
|
it("includes resilience permissions", () => {
|
|
const permissions = readManifest().permissions ?? [];
|
|
expect(permissions).toContain("alarms");
|
|
expect(permissions).toContain("webNavigation");
|
|
expect(permissions).toContain("storage");
|
|
expect(permissions).toContain("debugger");
|
|
});
|
|
});
|