Skip to content

Commit 574f02b

Browse files
committed
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 <[email protected]>
1 parent d75dcd7 commit 574f02b

File tree

3 files changed

+2
-7
lines changed

3 files changed

+2
-7
lines changed

apps/core/test/global.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import type { WrappedConsola } from '@innei/pretty-logger-nestjs/lib/consola'
22
import type { Document, PaginateModel } from 'mongoose'
33

44
import 'vitest/globals'
5-
import 'zx/globals'
65

76
import type { ModelType } from '@typegoose/typegoose/lib/types'
87

apps/core/test/setupFiles/lifecycle.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,11 @@
11
// @ts-nocheck
2-
import { beforeAll } from 'vitest'
3-
4-
import 'zx/globals'
5-
62
import { dbHelper } from 'test/helper/db-mock.helper'
73
import { redisHelper } from 'test/helper/redis-mock.helper'
4+
import { beforeAll } from 'vitest'
85

96
import { registerJSONGlobal } from '~/global/json.global'
107

118
beforeAll(async () => {
12-
await import('zx/globals')
13-
149
global.isDev = true
1510
global.cwd = process.cwd()
1611
global.consola = console

apps/core/test/src/utils/pic.util.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { pickImagesFromMarkdown } from '~/utils/pic.util'
2+
import { sleep } from '~/utils/tool.util'
23

34
describe('src/utils/pic.util', () => {
45
test('marked ast', async () => {

0 commit comments

Comments
 (0)