Skip to content

Commit 844a6b8

Browse files
committed
test: Migrate to Vitest
1 parent 79c1657 commit 844a6b8

Some content is hidden

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

57 files changed

+1100
-626
lines changed

.github/workflows/checks.yml

Lines changed: 7 additions & 7 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:
@@ -154,7 +154,7 @@ jobs:
154154
id: dependency-cache
155155
with:
156156
path: "**/node_modules"
157-
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
157+
key: ${{ runner.os }}-${{ hashFiles('**/package.json') }}-${{ hashFiles('**/yarn.lock') }}
158158
- name: Use build cache
159159
uses: actions/cache@v4
160160
with:
@@ -192,7 +192,7 @@ jobs:
192192
id: dependency-cache
193193
with:
194194
path: "**/node_modules"
195-
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
195+
key: ${{ runner.os }}-${{ hashFiles('**/package.json') }}-${{ hashFiles('**/yarn.lock') }}
196196
- name: Use build cache
197197
uses: actions/cache@v4
198198
with:
@@ -224,7 +224,7 @@ jobs:
224224
id: dependency-cache
225225
with:
226226
path: "**/node_modules"
227-
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
227+
key: ${{ runner.os }}-${{ hashFiles('**/package.json') }}-${{ hashFiles('**/yarn.lock') }}
228228
- name: Use build cache
229229
uses: actions/cache@v4
230230
with:
Lines changed: 1 addition & 8 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,
64
extends: ["@sentry-internal/eslint-config/jest", "@sentry-internal/eslint-config/base"],
7-
ignorePatterns: [".eslintrc.js", "dist", "jest.config.js", "rollup.config.mjs"],
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 & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
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": {
@@ -55,12 +55,10 @@
5555
"@sentry-internal/eslint-config": "4.9.1",
5656
"@sentry-internal/sentry-bundler-plugin-tsconfig": "4.9.1",
5757
"@swc/core": "^1.2.205",
58-
"@swc/jest": "^0.2.21",
59-
"@types/jest": "^28.1.3",
6058
"@types/node": "^18.6.3",
6159
"@types/uuid": "^9.0.1",
6260
"eslint": "^8.18.0",
63-
"jest": "^28.1.1",
61+
"vitest": "^4.0.0",
6462
"premove": "^4.0.0",
6563
"rolldown": "^1.0.0-rc.4",
6664
"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)