Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(solid): Switch to explicit vitest imports #13028

Merged
merged 1 commit into from
Jul 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion packages/solid/test/errorboundary.test.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
/* eslint-disable @typescript-eslint/unbound-method */
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';

import type * as SentryBrowser from '@sentry/browser';
import { createTransport, getCurrentScope, setCurrentClient } from '@sentry/core';
import { render } from '@solidjs/testing-library';
import userEvent from '@testing-library/user-event';
import { vi } from 'vitest';

import { ErrorBoundary } from 'solid-js';
import { BrowserClient, withSentryErrorBoundary } from '../src';
Expand Down
3 changes: 2 additions & 1 deletion packages/solid/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 { SDK_VERSION } from '@sentry/browser';
import * as SentryBrowser from '@sentry/browser';

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

const browserInit = vi.spyOn(SentryBrowser, 'init');
Expand Down
3 changes: 2 additions & 1 deletion packages/solid/test/solidrouter.test.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { beforeEach, describe, expect, it, vi } from 'vitest';

import { spanToJSON } from '@sentry/browser';
import {
SEMANTIC_ATTRIBUTE_SENTRY_OP,
Expand All @@ -10,7 +12,6 @@ import {
import type { MemoryHistory } from '@solidjs/router';
import { MemoryRouter, Navigate, Route, createMemoryHistory } from '@solidjs/router';
import { render } from '@solidjs/testing-library';
import { vi } from 'vitest';

import { BrowserClient } from '../src';
import { solidRouterBrowserTracingIntegration, withSentryRouterRouting } from '../src/solidrouter';
Expand Down
2 changes: 1 addition & 1 deletion packages/solid/tsconfig.test.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

"compilerOptions": {
// should include all types from `./tsconfig.json` plus types for all test frameworks used
"types": ["vitest/globals", "vite/client", "@testing-library/jest-dom"],
"types": ["vite/client", "@testing-library/jest-dom"],

// other package-specific, test-specific options
"jsx": "preserve",
Expand Down
1 change: 0 additions & 1 deletion packages/solid/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@ export default {
plugins: [solidPlugin({ hot: !process.env.VITEST })],
test: {
...baseConfig.test,
environment: 'jsdom',
},
};
Loading