test: add note controller case (#939)
This commit is contained in:
@@ -1,20 +0,0 @@
|
||||
// @ts-nocheck
|
||||
import { beforeAll } from 'vitest'
|
||||
|
||||
import 'zx/globals'
|
||||
|
||||
import consola from 'consola'
|
||||
|
||||
beforeAll(async () => {
|
||||
await import('zx/globals')
|
||||
|
||||
global.isDev = true
|
||||
global.cwd = process.cwd()
|
||||
global.consola = consola
|
||||
})
|
||||
|
||||
beforeEach(() => {
|
||||
global.isDev = true
|
||||
global.cwd = process.cwd()
|
||||
global.consola = consola
|
||||
})
|
||||
37
test/setupFiles/lifecycle.ts
Normal file
37
test/setupFiles/lifecycle.ts
Normal file
@@ -0,0 +1,37 @@
|
||||
// @ts-nocheck
|
||||
import { beforeAll } from 'vitest'
|
||||
|
||||
import 'zx/globals'
|
||||
|
||||
import consola from 'consola'
|
||||
import { dbHelper } from 'test/helper/db-mock.helper'
|
||||
import { redisHelper } from 'test/helper/redis-mock.helper'
|
||||
|
||||
import { registerJSONGlobal } from '~/global/json.global'
|
||||
|
||||
beforeAll(async () => {
|
||||
await import('zx/globals')
|
||||
|
||||
global.isDev = true
|
||||
global.cwd = process.cwd()
|
||||
global.consola = consola
|
||||
|
||||
registerJSONGlobal()
|
||||
})
|
||||
|
||||
afterAll(async () => {
|
||||
await dbHelper.clear()
|
||||
await dbHelper.close()
|
||||
await (await redisHelper).close()
|
||||
})
|
||||
|
||||
beforeAll(async () => {
|
||||
await dbHelper.connect()
|
||||
await redisHelper
|
||||
})
|
||||
|
||||
beforeEach(() => {
|
||||
global.isDev = true
|
||||
global.cwd = process.cwd()
|
||||
global.consola = consola
|
||||
})
|
||||
Reference in New Issue
Block a user