Skip to content

Commit 724e601

Browse files
committed
fix(test): provide db url to make prisma happy
1 parent 14d3aa7 commit 724e601

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"update-simple-git-hooks": "npx simple-git-hooks"
2727
},
2828
"simple-git-hooks": {
29-
"pre-push": "pnpm typecheck"
29+
"pre-push": "pnpm typecheck && pnpm test"
3030
},
3131
"dependencies": {
3232
"@hyperdx/node-opentelemetry": "^0.8.1",

packages/db/src/prisma-client.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,6 @@ const isCanceled = (
2727
organization.subscriptionCanceledAt < new Date();
2828

2929
const getPrismaClient = () => {
30-
if (process.env.NODE_ENV === 'test') {
31-
return new PrismaClient({
32-
log: ['error'],
33-
});
34-
}
35-
3630
const prisma = new PrismaClient({
3731
log: ['error'],
3832
})

vitest.shared.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ export const getSharedVitestConfig = ({
1111
},
1212
},
1313
test: {
14+
env: {
15+
// Not used, just so prisma is happy
16+
DATABASE_URL: 'postgresql://u:p@127.0.0.1:5432/db',
17+
},
1418
include: ['**/*.test.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
1519
browser: {
1620
name: 'chromium',

0 commit comments

Comments
 (0)