also looking at this
fix(tests): a fresh database has no user 1 and no hook secret
#4
2 files
+24
-3
| @@ -10,6 +10,14 @@ | ||
| 10 | 10 | if (!Bun.env.STRIPE_SECRET_KEY) |
| 11 | 11 | Bun.env.STRIPE_SECRET_KEY = 'sk_test_fake_key_for_testing' |
| 12 | 12 | |
| 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. | |
| 18 | if (!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 | ||
| 13 | 21 | import { applyRuntimeDirectoryEnv } from '@stacksjs/path' |
| 14 | 22 | import { setupTestEnvironment } from '@stacksjs/testing' |
| 15 | 23 | |