mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-11-23 23:27:37 +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()
|
|
})
|
|
}
|