Skip to content

Commit

Permalink
test(nestjs): Switch to explicit vitest imports (#13214)
Browse files Browse the repository at this point in the history
As per https://vitest.dev/config/#globals

> By default, vitest does not provide global APIs for explicitness

I think we should follow vitest defaults here and explicitly import in
the APIs that we need. This refactors our Nestjs SDK tests to do so.

ref #11084
  • Loading branch information
AbhiPrasad authored Aug 6, 2024
1 parent a099980 commit 0666eb5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 2 additions & 1 deletion packages/nestjs/test/sdk.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { beforeEach, describe, expect, it, vi } from 'vitest';

import * as SentryNode from '@sentry/node';
import { SDK_VERSION } from '@sentry/utils';

import { vi } from 'vitest';
import { init as nestInit } from '../src/sdk';

const nodeInit = vi.spyOn(SentryNode, 'init');
Expand Down
3 changes: 0 additions & 3 deletions packages/nestjs/tsconfig.test.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
"include": ["test/**/*", "vite.config.ts"],

"compilerOptions": {
// should include all types from `./tsconfig.json` plus types for all test frameworks used
"types": ["vitest/globals"]

// other package-specific, test-specific options
}
}

0 comments on commit 0666eb5

Please sign in to comment.