mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-10 00:50:42 +00:00
test: tighten googlechat auth redaction assertion
This commit is contained in:
@@ -506,24 +506,23 @@ describe("googlechat google auth runtime", () => {
|
||||
it("does not disclose raw credential paths or OS errors when file reads fail", async () => {
|
||||
const missingPath = path.join(os.tmpdir(), "googlechat-auth-missing", "service-account.json");
|
||||
|
||||
await expect(
|
||||
resolveValidatedGoogleChatCredentials({
|
||||
let thrown: unknown;
|
||||
try {
|
||||
await resolveValidatedGoogleChatCredentials({
|
||||
accountId: "default",
|
||||
config: {},
|
||||
credentialSource: "file",
|
||||
credentialsFile: missingPath,
|
||||
enabled: true,
|
||||
}),
|
||||
).rejects.toThrow("Failed to load Google Chat service account file.");
|
||||
});
|
||||
} catch (error) {
|
||||
thrown = error;
|
||||
}
|
||||
|
||||
await expect(
|
||||
resolveValidatedGoogleChatCredentials({
|
||||
accountId: "default",
|
||||
config: {},
|
||||
credentialSource: "file",
|
||||
credentialsFile: missingPath,
|
||||
enabled: true,
|
||||
}),
|
||||
).rejects.not.toThrow(/ENOENT|service-account\.json|googlechat-auth-missing/);
|
||||
expect(thrown).toBeInstanceOf(Error);
|
||||
expect((thrown as Error).message).toBe("Failed to load Google Chat service account file.");
|
||||
expect((thrown as Error).message).not.toMatch(
|
||||
/ENOENT|service-account\.json|googlechat-auth-missing/,
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user