Skip to content

Commit 0a416c2

Browse files
committed
minor #115 Migrate from Jest to to Vitest, close #104 (Kocal)
This PR was merged into the main branch. Discussion ---------- Migrate from Jest to to Vitest, close #104 See #104 Moving from Jest to Vitest removed ~3k lines in the pnpm lock file and removed ~300 devDependencies 😍 : - before: ``` Progress: resolved 1, reused 0, downloaded 0, added 0 Progress: resolved 101, reused 1, downloaded [8](https://github.com/symfony/stimulus-bridge/actions/runs/13020917798/job/36321161304?pr=114#step:6:9)7, added 0 Progress: resolved 251, reused 1, downloaded 214, added 0 Progress: resolved 441, reused 1, downloaded 3[9](https://github.com/symfony/stimulus-bridge/actions/runs/13020917798/job/36321161304?pr=114#step:6:10)0, added 0 Progress: resolved 694, reused 1, downloaded 627, added 0  WARN  11 deprecated subdependencies found: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected] Packages: +7[11](https://github.com/symfony/stimulus-bridge/actions/runs/13020917798/job/36321161304?pr=114#step:6:12) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Progress: resolved 732, reused 1, downloaded 714, added 711, done .../node_modules/core-js-pure postinstall$ node -e "try{require('./postinstall')}catch(e){}" .../node_modules/`@biomejs`/biome postinstall$ node scripts/postinstall.js .../node_modules/core-js-pure postinstall: Done .../node_modules/`@biomejs`/biome postinstall: Done dependencies: + `@hotwired`/stimulus-webpack-helpers 1.0.1 + `@types`/webpack-env 1.18.8 + loader-utils 3.3.1 + schema-utils 4.3.0 devDependencies: + `@babel`/core 7.26.7 + `@babel`/preset-env 7.26.7 + `@babel`/preset-typescript 7.26.0 + `@biomejs`/biome 1.9.4 + `@hotwired`/stimulus 3.2.2 + `@rollup`/plugin-typescript [12](https://github.com/symfony/stimulus-bridge/actions/runs/13020917798/job/36321161304?pr=114#step:6:13).1.2 + `@symfony`/mock-module 1.0.0 + `@symfony`/stimulus-testing 2.0.1 + acorn 8.14.0 + babel-jest 27.5.1 (29.7.0 is available) + jest 27.5.1 (29.7.0 is available) + rolldown 1.0.0-beta.3 + tslib 2.8.1 + typescript 4.9.5 (5.7.3 is available) + webpack 5.97.1 + webpack-cli 5.1.4 (6.0.1 is available)  WARN  Issues with peer dependencies found . └─┬ valibot 1.0.0-beta.12 └── ✕ unmet peer typescript@>=5: found 4.9.5 Done in 6.3s ``` - after: ``` Progress: resolved 1, reused 0, downloaded 0, added 0 Progress: resolved 11[8](https://github.com/symfony/stimulus-bridge/actions/runs/13026638540/job/36336794852?pr=115#step:6:9), reused 1, downloaded 99, added 0 Progress: resolved 284, reused 1, downloaded 243, added 0 Packages: +360 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Progress: resolved 423, reused 1, downloaded 364, added 360, done .../[email protected]/node_modules/esbuild postinstall$ node install.js .../node_modules/`@biomejs`/biome postinstall$ node scripts/postinstall.js .../[email protected]/node_modules/esbuild postinstall: Done .../node_modules/`@biomejs`/biome postinstall: Done dependencies: + `@hotwired`/stimulus-webpack-helpers 1.0.1 + `@types`/webpack-env 1.18.8 + loader-utils 3.3.1 + schema-utils 4.3.0 devDependencies: + `@babel`/core 7.26.7 + `@babel`/parser 7.26.7 + `@babel`/preset-env 7.26.7 + `@babel`/preset-typescript 7.26.0 + `@babel`/types 7.26.7 + `@biomejs`/biome 1.[9](https://github.com/symfony/stimulus-bridge/actions/runs/13026638540/job/36336794852?pr=115#step:6:10).4 + `@hotwired`/stimulus 3.2.2 + `@rollup`/plugin-typescript 12.1.2 + `@symfony`/mock-module 1.0.0 + `@testing`-library/jest-dom 6.6.3 + acorn 8.14.0 + jsdom 26.0.0 + json5 2.2.3 + rolldown 1.0.0-beta.3 + tslib 2.8.1 + typescript 4.9.5 (5.7.3 is available) + vitest 3.0.4 + webpack 5.97.1 + webpack-cli 5.1.4 (6.0.1 is available)  WARN  Issues with peer dependencies found . └─┬ valibot 1.0.0-beta.[12](https://github.com/symfony/stimulus-bridge/actions/runs/13026638540/job/36336794852?pr=115#step:6:13) └── ✕ unmet peer typescript@>=5: found 4.9.5 Done in 3.9s ``` Commits ------- 0db4bde Remove Jest and related dependencies, and migrate to Vitest, close #104
2 parents e0d0295 + 0db4bde commit 0a416c2

12 files changed

+1009
-4056
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
* Replace ESLint and Prettier by Biome.js by @Kocal in https://github.com/symfony/stimulus-bridge/pull/95
2323
* Migrate from [Rollup](https://rollupjs.org/) to [Rolldown](https://rolldown.rs/) by @Kocal in https://github.com/symfony/stimulus-bridge/pull/99
2424
* Migrate from [Yarn](https://yarnpkg.com/) to [pnpm](https://pnpm.io/) by @Kocal in https://github.com/symfony/stimulus-bridge/pull/108
25+
* Migrate from [Jest](https://jestjs.io/) to [Vitest](https://vitest.dev/) by @Kocal in https://github.com/symfony/stimulus-bridge/pull/115
2526

2627
## 3.3.3
2728

jest.config.js

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

package.json

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
"packageManager": "[email protected]+sha512.b2dc20e2fc72b3e18848459b37359a32064663e5627a51e4c74b2c29dd8e8e0491483c3abb40789cfd578bf362fb6ba8261b05f0387d76792ed6e23ea3b1b6a0",
1313
"scripts": {
1414
"build": "rolldown -c",
15-
"test": "webpack --config test/webpack.config.js && jest",
15+
"test": "webpack --config test/webpack.config.js && vitest run",
16+
"test:watch": "webpack --config test/webpack.config.js && vitest",
1617
"check": "biome check",
1718
"ci": "biome ci"
1819
},
@@ -27,25 +28,25 @@
2728
},
2829
"devDependencies": {
2930
"@babel/core": "^7.22.0",
31+
"@babel/parser": "^7.26.7",
3032
"@babel/preset-env": "^7.22.0",
3133
"@babel/preset-typescript": "^7.22.0",
34+
"@babel/types": "^7.26.7",
3235
"@biomejs/biome": "^1.9.4",
3336
"@hotwired/stimulus": "^3.0",
3437
"@rollup/plugin-typescript": "^12.1.2",
3538
"@symfony/mock-module": "file:test/fixtures/module",
36-
"@symfony/stimulus-testing": "^2.0.0",
39+
"@testing-library/jest-dom": "^6.6.3",
3740
"acorn": "^8.2.0",
38-
"babel-jest": "^27.3.1",
39-
"jest": "^27.3.1",
41+
"jsdom": "^26.0.0",
42+
"json5": "^2.2.3",
4043
"rolldown": "^1.0.0-beta.3",
4144
"tslib": "^2.3.1",
4245
"typescript": "^4.4.4",
46+
"vitest": "^3.0.4",
4347
"webpack": "^5.72",
4448
"webpack-cli": "^5.1.4"
4549
},
46-
"resolutions": {
47-
"@types/jest": "^27.0"
48-
},
4950
"files": [
5051
"src/",
5152
"dist/",

0 commit comments

Comments
 (0)