refactor(tests): remove zx globals import from global.d.ts and lifecycle.ts
- Eliminated unnecessary import of 'zx/globals' from both global.d.ts and lifecycle.ts files to streamline test setup. - Ensured that the test lifecycle remains intact while improving code clarity. Signed-off-by: Innei <tukon479@gmail.com>
This commit is contained in:
1
apps/core/test/global.d.ts
vendored
1
apps/core/test/global.d.ts
vendored
@@ -2,7 +2,6 @@ import type { WrappedConsola } from '@innei/pretty-logger-nestjs/lib/consola'
|
||||
import type { Document, PaginateModel } from 'mongoose'
|
||||
|
||||
import 'vitest/globals'
|
||||
import 'zx/globals'
|
||||
|
||||
import type { ModelType } from '@typegoose/typegoose/lib/types'
|
||||
|
||||
|
||||
@@ -1,16 +1,11 @@
|
||||
// @ts-nocheck
|
||||
import { beforeAll } from 'vitest'
|
||||
|
||||
import 'zx/globals'
|
||||
|
||||
import { dbHelper } from 'test/helper/db-mock.helper'
|
||||
import { redisHelper } from 'test/helper/redis-mock.helper'
|
||||
import { beforeAll } from 'vitest'
|
||||
|
||||
import { registerJSONGlobal } from '~/global/json.global'
|
||||
|
||||
beforeAll(async () => {
|
||||
await import('zx/globals')
|
||||
|
||||
global.isDev = true
|
||||
global.cwd = process.cwd()
|
||||
global.consola = console
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { pickImagesFromMarkdown } from '~/utils/pic.util'
|
||||
import { sleep } from '~/utils/tool.util'
|
||||
|
||||
describe('src/utils/pic.util', () => {
|
||||
test('marked ast', async () => {
|
||||
|
||||
Reference in New Issue
Block a user