Skip to content

Commit f551c70

Browse files
authored
test: Migrate to Vitest (#894)
1 parent ad180c3 commit f551c70

File tree

92 files changed

+1208
-1564
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+1208
-1564
lines changed

.github/workflows/checks.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
id: dependency-cache
2222
with:
2323
path: "**/node_modules"
24-
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
24+
key: ${{ runner.os }}-${{ hashFiles('**/package.json') }}-${{ hashFiles('**/yarn.lock') }}
2525
- name: Use build cache
2626
uses: actions/cache@v4
2727
with:
@@ -54,7 +54,7 @@ jobs:
5454
id: dependency-cache
5555
with:
5656
path: "**/node_modules"
57-
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
57+
key: ${{ runner.os }}-${{ hashFiles('**/package.json') }}-${{ hashFiles('**/yarn.lock') }}
5858
- name: Use build cache
5959
uses: actions/cache@v4
6060
with:
@@ -80,7 +80,7 @@ jobs:
8080
id: dependency-cache
8181
with:
8282
path: "**/node_modules"
83-
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
83+
key: ${{ runner.os }}-${{ hashFiles('**/package.json') }}-${{ hashFiles('**/yarn.lock') }}
8484
- name: Use build cache
8585
uses: actions/cache@v4
8686
with:
@@ -107,7 +107,7 @@ jobs:
107107
id: dependency-cache
108108
with:
109109
path: "**/node_modules"
110-
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
110+
key: ${{ runner.os }}-${{ hashFiles('**/package.json') }}-${{ hashFiles('**/yarn.lock') }}
111111
- name: Use build cache
112112
uses: actions/cache@v4
113113
with:
@@ -131,7 +131,7 @@ jobs:
131131
strategy:
132132
fail-fast: false
133133
matrix:
134-
node-version: ["18", "20", "22"]
134+
node-version: [18, 20, 22, 24]
135135
os: [ubuntu-latest, windows-latest]
136136
runs-on: ${{ matrix.os }}
137137
steps:
@@ -144,7 +144,7 @@ jobs:
144144
id: dependency-cache
145145
with:
146146
path: "**/node_modules"
147-
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
147+
key: ${{ runner.os }}-${{ hashFiles('**/package.json') }}-${{ hashFiles('**/yarn.lock') }}
148148
- name: Use build cache
149149
uses: actions/cache@v4
150150
with:
@@ -182,7 +182,7 @@ jobs:
182182
id: dependency-cache
183183
with:
184184
path: "**/node_modules"
185-
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
185+
key: ${{ runner.os }}-${{ hashFiles('**/package.json') }}-${{ hashFiles('**/yarn.lock') }}
186186
- name: Use build cache
187187
uses: actions/cache@v4
188188
with:
@@ -214,7 +214,7 @@ jobs:
214214
id: dependency-cache
215215
with:
216216
path: "**/node_modules"
217-
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
217+
key: ${{ runner.os }}-${{ hashFiles('**/package.json') }}-${{ hashFiles('**/yarn.lock') }}
218218
- name: Use build cache
219219
uses: actions/cache@v4
220220
with:
Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
const jestPackageJson = require("jest/package.json");
2-
31
/** @type {import('eslint').ESLint.Options} */
42
module.exports = {
53
root: true,
6-
extends: ["@sentry-internal/eslint-config/jest", "@sentry-internal/eslint-config/base"],
7-
ignorePatterns: [".eslintrc.js", "dist", "jest.config.js", "rollup.config.mjs"],
4+
extends: ["@sentry-internal/eslint-config/base"],
5+
ignorePatterns: [".eslintrc.js", "dist", "rollup.config.mjs"],
86
parserOptions: {
97
tsconfigRootDir: __dirname,
108
project: ["./src/tsconfig.json", "./test/tsconfig.json"],
@@ -15,9 +13,4 @@ module.exports = {
1513
env: {
1614
node: true,
1715
},
18-
settings: {
19-
jest: {
20-
version: jestPackageJson.version,
21-
},
22-
},
2316
};

packages/babel-plugin-component-annotate/jest.config.js

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

packages/babel-plugin-component-annotate/package.json

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,20 +46,17 @@
4646
"clean:all": "run-p clean clean:deps",
4747
"clean:build": "premove ./dist *.tgz",
4848
"clean:deps": "premove node_modules",
49-
"test": "jest",
49+
"test": "vitest run",
5050
"lint": "eslint ./src ./test"
5151
},
5252
"devDependencies": {
5353
"@babel/core": "7.18.5",
5454
"@babel/preset-react": "^7.23.3",
5555
"@sentry-internal/eslint-config": "5.1.1",
5656
"@sentry-internal/sentry-bundler-plugin-tsconfig": "5.1.1",
57-
"@swc/core": "^1.2.205",
58-
"@swc/jest": "^0.2.21",
59-
"@types/jest": "^28.1.3",
6057
"@types/node": "^18.6.3",
6158
"eslint": "^8.18.0",
62-
"jest": "^28.1.1",
59+
"vitest": "^4.0.0",
6360
"premove": "^4.0.0",
6461
"rolldown": "^1.0.0-rc.4",
6562
"ts-node": "^10.9.1",

packages/babel-plugin-component-annotate/test/__snapshots__/test-plugin.test.ts.snap

Lines changed: 186 additions & 186 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)