mirror of
https://github.com/CloakHQ/CloakBrowser.git
synced 2026-06-23 11:41:46 +02:00
- Add PLATFORM_CHROMIUM_VERSIONS map (Linux=v145, macOS=v142) - Add get_chromium_version()/getChromiumVersion() for platform-specific version - Make auto-update check release assets before offering updates - Scope version markers per-platform (latest_version_linux-x64) - Support 5th version segment for hotfix builds (e.g. 145.0.7632.109.2) - Derive AVAILABLE_PLATFORMS from version map
40 lines
1.3 KiB
TypeScript
40 lines
1.3 KiB
TypeScript
import { describe, it, expect } from "vitest";
|
|
import { binaryInfo } from "../src/download.js";
|
|
import { getChromiumVersion } from "../src/config.js";
|
|
|
|
describe("binaryInfo", () => {
|
|
it("returns correct structure", () => {
|
|
const info = binaryInfo();
|
|
|
|
expect(info.version).toBe(getChromiumVersion());
|
|
expect(info.platform).toMatch(/^(linux|darwin)-(x64|arm64)$/);
|
|
expect(info.binaryPath).toBeTruthy();
|
|
expect(typeof info.installed).toBe("boolean");
|
|
expect(info.cacheDir).toContain("cloakbrowser");
|
|
expect(info.downloadUrl).toContain(".tar.gz");
|
|
});
|
|
});
|
|
|
|
// Integration tests require the binary — run with:
|
|
// CLOAKBROWSER_BINARY_PATH=/path/to/chrome npm test
|
|
describe.skipIf(!process.env.CLOAKBROWSER_BINARY_PATH)(
|
|
"launch (integration)",
|
|
() => {
|
|
it("launches browser and checks stealth", async () => {
|
|
const { launch } = await import("../src/playwright.js");
|
|
|
|
const browser = await launch({ headless: true });
|
|
const page = await browser.newPage();
|
|
await page.goto("about:blank");
|
|
|
|
const webdriver = await page.evaluate(() => navigator.webdriver);
|
|
expect(webdriver).toBeFalsy();
|
|
|
|
const plugins = await page.evaluate(() => navigator.plugins.length);
|
|
expect(plugins).toBeGreaterThan(0);
|
|
|
|
await browser.close();
|
|
}, 30_000);
|
|
}
|
|
);
|