Open AbhiPrasad opened 8 months ago
vistest
was already added to Angular here: https://github.com/getsentry/sentry-javascript/pull/11091
I will check it on the list 👍🏻
@AbhiPrasad Replay was migrated here: https://github.com/getsentry/sentry-javascript/pull/11899
edit though we are using globals and not importing everything from vitest
Looks like the task list needs updating because Node v14 doesn't support vitest?
I updated it - looks like we are stuck with jest longer than I thought.
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 trapsjest
does in terms of esm compatibility. Example attempt with Vue SDK: https://github.com/getsentry/sentry-javascript/pull/11071In 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.
First we should align on a common vitest testing standard. Right now we use set globals via
vitest/globals
, but this is not recommended byvitest
themselves. We should instead use direct imports likeimport { describe, test, expect } from 'vitest';
.https://github.com/getsentry/sentry-javascript/blob/780875fd9d13ef6be5f7f894b97c48777022f5e9/tsconfig.dev.json#L8
There'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.
We can then tackle the following list in whatever order we want!
We also have some packages that use
mocha
. We should try to drop that dependency and make them usevitest