test: harden package boundaries and audit budgets
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@wrnexus/captcha",
|
||||
"version": "0.8.13",
|
||||
"version": "0.8.14",
|
||||
"description": "First-class CAPTCHA challenges, providers, verification guards, page gates, and WRNexusJS UI.",
|
||||
"type": "module",
|
||||
"sideEffects": false,
|
||||
|
||||
@@ -47,4 +47,17 @@ describe("CAPTCHA helper boundaries", () => {
|
||||
).toEqual({ success: true, provider: "custom", action: "login" });
|
||||
expect(captchaContext({ locals: { captcha: "forged" } } as never)).toBeNull();
|
||||
});
|
||||
|
||||
test("does not convert provider transport failures into successful verification", async () => {
|
||||
const provider = {
|
||||
name: "custom" as const,
|
||||
client: { responseField: "captchaToken" },
|
||||
verify: async () => {
|
||||
throw new Error("provider timeout");
|
||||
},
|
||||
};
|
||||
await expect(
|
||||
verifyCaptchaOrThrow(provider, { providerToken: "x", action: "checkout" }),
|
||||
).rejects.toThrow("provider timeout");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user