Title: Migrate from jest to vitest and stop using jsdom based tests · Issue #11084 · getsentry/sentry-javascript · GitHub
Open Graph Title: Migrate from jest to vitest and stop using jsdom based tests · Issue #11084 · getsentry/sentry-javascript
X Title: Migrate from jest to vitest and stop using jsdom based tests · Issue #11084 · getsentry/sentry-javascript
Description: After v8 gets merged in, let's look at migrating from jest to vitest. vitest is way faster, and doesn't fall into the same traps jest does in terms of esm compatibility. Example attempt with Vue SDK: #11071 In addition, we should stop us...
Open Graph Description: After v8 gets merged in, let's look at migrating from jest to vitest. vitest is way faster, and doesn't fall into the same traps jest does in terms of esm compatibility. Example attempt with Vue SD...
X Description: After v8 gets merged in, let's look at migrating from jest to vitest. vitest is way faster, and doesn't fall into the same traps jest does in terms of esm compatibility. Example attempt wit...
Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/11084
X: @github
Domain: github.com
IPv4 address: 140.82.113.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Migrate from jest to vitest and stop using jsdom based tests","articleBody":"After v8 gets merged in, let's look at migrating from jest to vitest. `vitest` is way faster, and doesn't fall into the same traps `jest` does in terms of esm compatibility. Example attempt with Vue SDK: https://github.com/getsentry/sentry-javascript/pull/11071\n\nIn addition, we should stop using jsdom based tests, and instead move tests that rely on the browser to use playwright instead. Simulating jsdom in an node environment always has it's faults, easier to not attempt to do that.\n\nFirst we should align on a common vitest testing standard. Right now we use set globals via `vitest/globals`, but this is not recommended by `vitest` themselves. We should instead use direct imports like `import { describe, test, expect } from 'vitest';`.\n\nhttps://github.com/getsentry/sentry-javascript/blob/780875fd9d13ef6be5f7f894b97c48777022f5e9/tsconfig.dev.json#L8\n\nThere's probably some other discussion that needs to be done here too. We can validate our decisions by changing our vitest usage in the Astro and SvelteKit SDKs.\n\n```[tasklist]\n### Update existing vitest usage\n- [ ] https://github.com/getsentry/sentry-javascript/pull/13093\n- [ ] https://github.com/getsentry/sentry-javascript/pull/13214\n- [ ] Nuxt SDK\n- [ ] https://github.com/getsentry/sentry-javascript/pull/13028\n- [ ] SolidStart SDK\n- [ ] https://github.com/getsentry/sentry-javascript/pull/13026\n- [ ] https://github.com/getsentry/sentry-javascript/pull/12960\n- [ ] https://github.com/getsentry/sentry-javascript/pull/13027\n```\n\nWe can then tackle the following list in whatever order we want!\n\n```[tasklist]\n### Convert to using vitest\n- [x] Angular https://github.com/getsentry/sentry-javascript/pull/11091\n- [ ] https://github.com/getsentry/sentry-javascript/pull/13092\n- [ ] https://github.com/getsentry/sentry-javascript/issues/13434\n- [x] Browser Utils\n- [ ] https://github.com/getsentry/sentry-javascript/pull/15497\n- [ ] https://github.com/getsentry/sentry-javascript/pull/15494\n- [ ] https://github.com/getsentry/sentry-javascript/issues/13605\n- [ ] https://github.com/getsentry/sentry-javascript/pull/15492\n- [ ] https://github.com/getsentry/sentry-javascript/pull/12964\n- [ ] https://github.com/getsentry/sentry-javascript/pull/11899\n- [ ] https://github.com/getsentry/sentry-javascript/pull/12961\n- [ ] https://github.com/getsentry/sentry-javascript/pull/12958\n- [ ] https://github.com/getsentry/sentry-javascript/pull/12955\n- [x] Wasm\n- [ ] https://github.com/getsentry/sentry-javascript/pull/15499\n- [ ] https://github.com/getsentry/sentry-javascript/pull/15546\n```\n\nWe also have some packages that use `mocha`. We should try to drop that dependency and make them use `vitest`\n\n```[tasklist]\n### Remove mocha\n- [ ] https://github.com/getsentry/sentry-javascript/pull/11296\n- [ ] https://github.com/getsentry/sentry-javascript/pull/11412\n- [ ] https://github.com/getsentry/sentry-javascript/pull/11436\n- [ ] https://github.com/getsentry/sentry-javascript/pull/11449\n- [ ] https://github.com/getsentry/sentry-javascript/pull/11666\n- [ ] https://github.com/getsentry/sentry-javascript/pull/11688\n- [ ] https://github.com/getsentry/sentry-javascript/pull/11733\n- [ ] https://github.com/getsentry/sentry-javascript/pull/11758\n```\n","author":{"url":"https://github.com/AbhiPrasad","@type":"Person","name":"AbhiPrasad"},"datePublished":"2024-03-13T18:26:24Z","url":"https://github.com/getsentry/sentry-javascript/issues/11084"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:c82b4ff0-96fd-ebf7-dd8b-3c5b010b98d7 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B98E:7DF65:19399C8:20FDB23:6B040290 |
| html-safe-nonce | a7db5d5e44e7e8a92bf6aa3571637e5812c096529347631a659bf912645ffb00 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCOThFOjdERjY1OjE5Mzk5Qzg6MjBGREIyMzo2QjA0MDI5MCIsInZpc2l0b3JfaWQiOiIxNDcwNzAwMzU1NjA3MzMxNDcyIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 9708194509cad4b10d0307f7d13aaa3c96fa1ad6bf8ceea1bade65f9bf57be16 |
| hovercard-subject-tag | issue:2184640876 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getsentry/sentry-javascript/11084/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b5ef7944a8568b8fdedacc41ccdfe9defca1897a87d41a26eadc900ab50df0c7/getsentry/sentry-javascript/issues/11084 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b5ef7944a8568b8fdedacc41ccdfe9defca1897a87d41a26eadc900ab50df0c7/getsentry/sentry-javascript/issues/11084 |
| og:image:alt | After v8 gets merged in, let's look at migrating from jest to vitest. vitest is way faster, and doesn't fall into the same traps jest does in terms of esm compatibility. Example attempt with Vue SD... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | AbhiPrasad |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| go-import | github.com/getsentry/sentry-javascript git https://github.com/getsentry/sentry-javascript.git |
| octolytics-dimension-user_id | 1396951 |
| octolytics-dimension-user_login | getsentry |
| octolytics-dimension-repository_id | 3328572 |
| octolytics-dimension-repository_nwo | getsentry/sentry-javascript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 3328572 |
| octolytics-dimension-repository_network_root_nwo | getsentry/sentry-javascript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width