test: check minted gateway token format

This commit is contained in:
Shakker
2026-05-12 06:10:59 +01:00
parent 3c66de8010
commit 354a6ddefd

View File

@@ -156,8 +156,7 @@ describe("runDaemonInstall integration", () => {
const updated = await readJson(configPath);
const gateway = (updated.gateway ?? {}) as { auth?: { token?: string } };
const persistedToken = gateway.auth?.token;
expect(typeof persistedToken).toBe("string");
expect((persistedToken ?? "").length).toBeGreaterThan(0);
expect(persistedToken).toEqual(expect.stringMatching(/^[0-9a-f]{48}$/));
const installEnv = serviceMock.install.mock.calls[0]?.[0]?.environment;
expect(installEnv?.OPENCLAW_GATEWAY_TOKEN).toBeUndefined();