ReviewOS

also looking at this

reviewos/reviewos.org

fix(tests): a fresh database has no user 1 and no hook secret

#4
Merged glennmichael123 wants to merge fix/repo-delete-test-seeds into main
2 files +24 -3
tests/setup.tsmodified+8-0
Changes to tests/setup.ts
@@ -10,6 +10,14 @@
1010if (!Bun.env.STRIPE_SECRET_KEY)
1111 Bun.env.STRIPE_SECRET_KEY = 'sk_test_fake_key_for_testing'
1212
13// A run-local hook secret, when the checkout has not configured one. An empty
14// secret deliberately disables the post-receive endpoint (a default secret is
15// a published secret), which on a fresh `.env` makes git-http's push-pipeline
16// test fail for configuration rather than for code. Random per run, so it is
17// never a value anything can come to depend on.
18if (!Bun.env.GIT_HOOK_SECRET || Bun.env.GIT_HOOK_SECRET.trim().length < 16)
19 Bun.env.GIT_HOOK_SECRET = Buffer.from(crypto.getRandomValues(new Uint8Array(24))).toString('hex')
20
1321import { applyRuntimeDirectoryEnv } from '@stacksjs/path'
1422import { setupTestEnvironment } from '@stacksjs/testing'
1523