quasarframework / quasar-testing

Testing Harness App Extensions for the Quasar Framework 2.0+
https://testing.quasar.dev
MIT License
179 stars 66 forks source link

Explore using `ts-jest` presets to power our own Jest preset #290

Open IlCallo opened 2 years ago

IlCallo commented 2 years ago

Not sure if it can bring any advantage, but we could explore using ts-jest presets to simplify our

Some random notes:

Resources:

Blfrg commented 2 years ago

I recently started using SWC on a small [non-ui] project, and I swapped out ts-jest for @swc/jest. My [very minimal] tests were 5x faster with barely any effort!

I haven't had time to test a more complex project, but I would expect to see significant improvements.

IlCallo commented 2 years ago

IIRC SWC problem is its download size, but right now I see that it's much smaller than ts-jest Do we need to add anything else except @swc/jest? Do you know which are the downsides of its usage when compared with ts-jest + esbuild which should be much faster than ts-jest alone?

I found this article which compare esbuild to SWC and results are similar

Blfrg commented 2 years ago

Only the two steps in the docs are needed. The only other dependency is @swc/core, which is understandable, and I would consider it internal to the project.

I believe the performance compared to esbuild is just about equal, but maybe specific projects would prove one negligibly beneficial over the other.

Regarding downsides, just the chaining of the two projects, ts-jest and esbuild, maybe there will be compatibility or performance conflicts one day, and maybe not at all.

I went with SWC because it was self-contained, and I needed ES5 support for a back-end project (non-Vue, non-UI); that was my only drawback with esbuild.

I would have preferred esbuild otherwise; since the whole Vue community is rallying around Vite and Vitest, the dependency would have matched. Maybe in that sense, esbuild would be a better match (or Vitest?), with similar dependencies across the Quasar ecosystem.