mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-12-02 05:54:44 +00:00
initial commit
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
import { afterEach, beforeEach } from 'vitest'
|
||||
import { getPrismaTestingHelper } from '@/db'
|
||||
|
||||
export function setupTestDbHooks() {
|
||||
beforeEach(async () => {
|
||||
await getPrismaTestingHelper().startNewTransaction()
|
||||
})
|
||||
|
||||
afterEach(() => {
|
||||
getPrismaTestingHelper().rollbackCurrentTransaction()
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user