Skip to content

Commit 7a9ccae

Browse files
committed
test(replay-canvas): Switch to using vitest
1 parent b4272be commit 7a9ccae

File tree

5 files changed

+17
-12
lines changed

5 files changed

+17
-12
lines changed

packages/replay-canvas/jest.config.js

Lines changed: 0 additions & 6 deletions
This file was deleted.

packages/replay-canvas/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@
4747
"clean": "rimraf build sentry-replay-*.tgz",
4848
"fix": "eslint . --format stylish --fix",
4949
"lint": "eslint . --format stylish",
50-
"test": "jest",
51-
"test:watch": "jest --watch",
50+
"test": "vitest run",
51+
"test:watch": "vitest --watch",
5252
"yalc:publish": "yalc publish --push --sig"
5353
},
5454
"publishConfig": {

packages/replay-canvas/test/canvas.test.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
1+
/**
2+
* @vitest-environment jsdom
3+
*/
4+
5+
import { beforeEach, expect, it, vi } from 'vitest';
6+
17
import { CanvasManager } from '@sentry-internal/rrweb';
28
import { _replayCanvasIntegration, replayCanvasIntegration } from '../src/canvas';
39

4-
jest.mock('@sentry-internal/rrweb');
10+
vi.mock('@sentry-internal/rrweb');
511

612
beforeEach(() => {
7-
jest.clearAllMocks();
13+
vi.clearAllMocks();
814
});
915

1016
it('initializes with default options', () => {

packages/replay-canvas/tsconfig.test.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
22
"extends": "./tsconfig.json",
33

4-
"include": ["test/**/*.ts", "jest.config.ts", "jest.setup.ts"],
4+
"include": ["test/**/*.ts", "vite.config.ts"],
55

66
"compilerOptions": {
77
"lib": ["DOM", "ES2018"],
8-
"types": ["node", "jest"],
8+
"types": ["node"],
99
"esModuleInterop": true,
1010
"allowJs": true,
1111
"noImplicitAny": true,

packages/replay-canvas/vite.config.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import baseConfig from '../../vite/vite.config';
2+
3+
export default {
4+
...baseConfig,
5+
};

0 commit comments

Comments
 (0)