Add comprehensive test suite for express modules
Tests for: - user.ts: User class, roles, permissions, status checks - util.ts: loadFile utility - handlers.ts: multiHandler - types.ts: methodParser, requireAuth, requirePermission - logging.ts: module structure - database.ts: connectionConfig, raw queries, PostgresAuthStore - auth/token.ts: generateToken, hashToken, parseAuthorizationHeader - auth/password.ts: hashPassword, verifyPassword (scrypt) - auth/types.ts: Zod parsers, Session class, tokenLifetimes - auth/store.ts: InMemoryAuthStore - auth/service.ts: AuthService (login, register, verify, reset) - basic/*.ts: route structure tests Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
24
express/basic/logout.spec.ts
Normal file
24
express/basic/logout.spec.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
// Tests for basic/logout.ts
|
||||
// These tests verify the route structure and export
|
||||
|
||||
import assert from "node:assert/strict";
|
||||
import { describe, it } from "node:test";
|
||||
import { logoutRoute } from "./logout";
|
||||
|
||||
describe("basic/logout", () => {
|
||||
describe("logoutRoute", () => {
|
||||
it("has correct path", () => {
|
||||
assert.equal(logoutRoute.path, "/logout");
|
||||
});
|
||||
|
||||
it("handles GET and POST methods", () => {
|
||||
assert.ok(logoutRoute.methods.includes("GET"));
|
||||
assert.ok(logoutRoute.methods.includes("POST"));
|
||||
assert.equal(logoutRoute.methods.length, 2);
|
||||
});
|
||||
|
||||
it("has a handler function", () => {
|
||||
assert.equal(typeof logoutRoute.handler, "function");
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user