cruxy › fix the failing tests in the auth module
! cruxy wants to run tests: pnpm test (destructive)
$ pnpm test
in /home/dev/web
[y] once · [a] always allow test runs of exactly `pnpm test` this session · [t] reject & instruct · [n] no: a
✗ tests failed · 2 of 42 failed · 3.1s · pnpm test
✗ signs a session token src/auth/session.test.ts:18
expected "ok"
received undefined
✗ rejects an expired token src/auth/session.test.ts:41
why (inferred) TOKEN_SECRET is not set in the test environment
✓ read_file 8ms src/test/setup.ts
? cruxy wants to edit: src/test/setup.ts (mutate)
Update(src/test/setup.ts) +1
1 process.env.NODE_ENV = "test";
2 + process.env.TOKEN_SECRET = "test-secret";
[y] once · [a] always allow changes under test/ this session · [t] reject & instruct · [n] no: y
✓ edit_file 11ms src/test/setup.ts
✓ tests passed · 42 tests · 2.9s · pnpm test
The test setup now sets TOKEN_SECRET. All 42 tests pass.
usage · kavi ↑ 12.5k ↓ 530 0.0141 USD · total ↑ 12.5k ↓ 530 0.0141 USD
$▌