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(replay-canvas): Switch to using vitest #12964

Merged
merged 1 commit into from
Jul 17, 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
14 changes: 0 additions & 14 deletions packages/replay-canvas/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,4 @@

module.exports = {
extends: ['../../.eslintrc.js'],
overrides: [
{
files: ['src/**/*.ts'],
},
{
files: ['jest.setup.ts', 'jest.config.ts'],
parserOptions: {
project: ['tsconfig.test.json'],
},
rules: {
'no-console': 'off',
},
},
],
};
6 changes: 0 additions & 6 deletions packages/replay-canvas/jest.config.js

This file was deleted.

5 changes: 2 additions & 3 deletions packages/replay-canvas/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@
"clean": "rimraf build sentry-replay-*.tgz",
"fix": "eslint . --format stylish --fix",
"lint": "eslint . --format stylish",
"test": "jest",
"test:watch": "jest --watch",
"test": "vitest run",
"test:watch": "vitest --watch",
"yalc:publish": "yalc publish --push --sig"
},
"publishConfig": {
Expand All @@ -65,7 +65,6 @@
},
"homepage": "https://docs.sentry.io/platforms/javascript/session-replay/",
"devDependencies": {
"@babel/core": "^7.17.5",
"@sentry-internal/rrweb": "2.25.0"
},
"dependencies": {
Expand Down
10 changes: 8 additions & 2 deletions packages/replay-canvas/test/canvas.test.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
/**
* @vitest-environment jsdom
*/

import { beforeEach, expect, it, vi } from 'vitest';

import { CanvasManager } from '@sentry-internal/rrweb';
import { _replayCanvasIntegration, replayCanvasIntegration } from '../src/canvas';

jest.mock('@sentry-internal/rrweb');
vi.mock('@sentry-internal/rrweb');

beforeEach(() => {
jest.clearAllMocks();
vi.clearAllMocks();
});

it('initializes with default options', () => {
Expand Down
4 changes: 2 additions & 2 deletions packages/replay-canvas/tsconfig.test.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"extends": "./tsconfig.json",

"include": ["test/**/*.ts", "jest.config.ts", "jest.setup.ts"],
"include": ["test/**/*.ts", "vite.config.ts"],

"compilerOptions": {
"lib": ["DOM", "ES2018"],
"types": ["node", "jest"],
"types": ["node"],
"esModuleInterop": true,
"allowJs": true,
"noImplicitAny": true,
Expand Down
5 changes: 5 additions & 0 deletions packages/replay-canvas/vite.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import baseConfig from '../../vite/vite.config';

export default {
...baseConfig,
};
Loading