mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-11-22 06:57:40 +00:00
13 lines
306 B
TypeScript
13 lines
306 B
TypeScript
import { afterEach, beforeEach } from 'vitest'
|
|
import { getPrismaTestingHelper } from '@/db'
|
|
|
|
export function setupTestDbHooks() {
|
|
beforeEach(async () => {
|
|
await getPrismaTestingHelper().startNewTransaction()
|
|
})
|
|
|
|
afterEach(() => {
|
|
getPrismaTestingHelper().rollbackCurrentTransaction()
|
|
})
|
|
}
|