mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-16 04:27:21 +00:00
14 lines
529 B
TypeScript
14 lines
529 B
TypeScript
import { PasswordStrategy } from "auth/authenticate/strategies/PasswordStrategy";
|
|
import { describe, expect, it } from "bun:test";
|
|
|
|
describe("PasswordStrategy", () => {
|
|
it("should enforce provided minimum length", async () => {
|
|
const strategy = new PasswordStrategy({ minLength: 8, hashing: "plain" });
|
|
|
|
expect(strategy.verify("password")({} as any)).rejects.toThrow();
|
|
expect(
|
|
strategy.verify("password1234")({ strategy_value: "password1234" } as any),
|
|
).resolves.toBeUndefined();
|
|
});
|
|
});
|