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

Assuming all jest should have been removed in #1033 #1511

Merged
merged 2 commits into from
Jun 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
2 changes: 2 additions & 0 deletions .changeset/last-jest-to-vitest.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"@typescript-eslint/parser": "^5.62.0",
"browserslist": "^4.22.1",
"concurrently": "^7.1.0",
"cross-env": "^7.0.3",
"esbuild-plugin-umd-wrapper": "^2.0.0",
"eslint": "^8.53.0",
"eslint-plugin-compat": "^4.2.0",
Expand Down
8 changes: 4 additions & 4 deletions packages/rrweb-snapshot/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
"scripts": {
"prepare": "npm run prepack",
"prepack": "npm run build",
"retest": "jest",
"test": "vitest run",
"retest": "vitest run",
"test": "yarn build && vitest run",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably decouple these a bit, turbo.json already has the relationship between build and test. If we add it here, build ends up being called twice

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

turbo.json is only in root; will we be adding one in this package too?
the difference between test and retest that I introduced was the idea that you have changed the code and want to check the tests, vs. modifying a test and you want to check if the modification fixes things (no need to build, hence 'retest').
Is there a way that can work with turbo, e.g. automatically it knows that there's no need to build as the files haven't changed?

Copy link
Contributor

@Juice10 Juice10 Jun 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Turbo looks at the config file in the root to understand the relationships.

When you run a command with turbo for example turbo run test -F PACKAGE it will run build only if the code was changed, otherwise it will use the cached output.

"test:watch": "vitest watch",
"test:update": "vitest run --update",
"retest:update": "vitest run --update",
"test:update": "yarn build && vitest run --update",
"dev": "vite build --watch",
"build": "yarn check-types && vite build",
"check-types": "tsc --noEmit",
Expand Down Expand Up @@ -55,7 +56,6 @@
"@types/jsdom": "^20.0.0",
"@types/node": "^18.15.11",
"@types/puppeteer": "^5.4.4",
"cross-env": "^5.2.0",
"puppeteer": "^17.1.3",
"ts-node": "^7.0.1",
"tslib": "^1.9.3",
Expand Down
9 changes: 4 additions & 5 deletions packages/rrweb/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
"prepack": "npm run build",
"retest": "vitest run --exclude test/benchmark",
"build-and-test": "yarn build && yarn retest",
"test:headless": "PUPPETEER_HEADLESS=true yarn build-and-test",
"test:headful": "PUPPETEER_HEADLESS=false yarn build-and-test",
"test:headless": "cross-env PUPPETEER_HEADLESS=true yarn build-and-test",
"test:headful": "cross-env PUPPETEER_HEADLESS=false yarn build-and-test",
"test": "yarn test:headless",
"test:watch": "yarn build && PUPPETEER_HEADLESS=true yarn vitest --exclude test/benchmark",
"test:watch": "yarn build && cross-env PUPPETEER_HEADLESS=true yarn vitest --exclude test/benchmark",
"test:update": "yarn test:headless --update",
"retest:update": "PUPPETEER_HEADLESS=true yarn retest --update",
"retest:update": "cross-env PUPPETEER_HEADLESS=true yarn retest --update",
"repl": "yarn build && node scripts/repl.js",
"live-stream": "yarn build && node scripts/stream.js",
"dev": "vite build --watch",
Expand Down Expand Up @@ -65,7 +65,6 @@
"@types/node": "^18.15.11",
"@types/offscreencanvas": "^2019.6.4",
"construct-style-sheets-polyfill": "^3.1.0",
"cross-env": "^5.2.0",
"fast-mhtml": "^1.1.9",
"identity-obj-proxy": "^3.0.0",
"ignore-styles": "^5.0.1",
Expand Down
1 change: 0 additions & 1 deletion packages/web-extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
"@types/react-dom": "^18.0.6",
"@types/webextension-polyfill": "^0.9.1",
"@vitejs/plugin-react": "^4.2.1",
"cross-env": "^7.0.3",
"type-fest": "^2.19.0",
"vite": "^5.2.8",
"vite-plugin-web-extension": "^4.1.3",
Expand Down
30 changes: 1 addition & 29 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4740,13 +4740,6 @@ create-require@^1.1.0:
resolved "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz"
integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==

cross-env@^5.2.0:
version "5.2.1"
resolved "https://registry.npmjs.org/cross-env/-/cross-env-5.2.1.tgz"
integrity sha512-1yHhtcfAd1r4nwQgknowuUNfIT9E8dOMMspC36g45dN+iD1blloi7xp8X/xAIDnjHWyt1uQ8PHk2fkNaym7soQ==
dependencies:
cross-spawn "^6.0.5"

cross-env@^7.0.3:
version "7.0.3"
resolved "https://registry.yarnpkg.com/cross-env/-/cross-env-7.0.3.tgz#865264b29677dc015ba8418918965dd232fc54cf"
Expand Down Expand Up @@ -4777,17 +4770,6 @@ cross-spawn@^5.1.0:
shebang-command "^1.2.0"
which "^1.2.9"

cross-spawn@^6.0.5:
version "6.0.5"
resolved "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz"
integrity sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==
dependencies:
nice-try "^1.0.4"
path-key "^2.0.1"
semver "^5.5.0"
shebang-command "^1.2.0"
which "^1.2.9"

cross-spawn@^7.0.1, cross-spawn@^7.0.2, cross-spawn@^7.0.3:
version "7.0.3"
resolved "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz"
Expand Down Expand Up @@ -8518,11 +8500,6 @@ netmask@^2.0.2:
resolved "https://registry.yarnpkg.com/netmask/-/netmask-2.0.2.tgz#8b01a07644065d536383835823bc52004ebac5e7"
integrity sha512-dBpDMdxv9Irdq66304OLfEmQ9tbNRFnFTuZiLo+bD+r332bBmMJ8GBLXklIXXgxd3+v9+KUnZaUR5PJMa75Gsg==

nice-try@^1.0.4:
version "1.0.5"
resolved "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz"
integrity sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==

no-case@^3.0.4:
version "3.0.4"
resolved "https://registry.yarnpkg.com/no-case/-/no-case-3.0.4.tgz#d361fd5c9800f558551a8369fc0dcd4662b6124d"
Expand Down Expand Up @@ -8941,11 +8918,6 @@ path-is-absolute@^1.0.0:
resolved "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz"
integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18=

path-key@^2.0.1:
version "2.0.1"
resolved "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz"
integrity sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=

path-key@^3.0.0, path-key@^3.1.0:
version "3.1.1"
resolved "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz"
Expand Down Expand Up @@ -9850,7 +9822,7 @@ [email protected]:
dependencies:
semver "^5.1.0"

"semver@2 || 3 || 4 || 5", semver@^5.1.0, semver@^5.5.0:
"semver@2 || 3 || 4 || 5", semver@^5.1.0:
version "5.7.1"
resolved "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz"
integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==
Expand Down
Loading