You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: apps/cookbook/docs/angular/testing/01-vitest/01-why-vitest.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,15 +12,15 @@ Since the deprecation of [Karma](https://karma-runner.github.io/latest/index.htm
12
12
13
13
-[Jest](https://jestjs.io/)
14
14
-[Vitest](https://vitest.dev/)
15
-
-[Web Test Runner](https://modern-web.dev/docs/test-runner/overview/) (_While promising, Web Test Runner is still in its early stages so we will not consider it in this comparison._)
15
+
-[Web Test Runner](https://modern-web.dev/docs/test-runner/overview/) (_While promising, Web Test Runner is still in its early stages, so we will not consider it in this comparison._)
16
16
17
17
While both Jest and Vitest are mature and widely used in the web ecosystem, Jest has been massively adopted by the Angular community for many years. However, **Vitest is gaining traction and is fixing many of the pain points that Angular developers have been facing with Jest**.
18
18
19
19
Let's explore some of the reasons why you should consider using Vitest for your Angular projects.
20
20
21
21
## π¦ ESM Support
22
22
23
-
Vitest was design with ECMAScript modules (ESM) compatibility in mind. This means that Vitest supports ESM out of the box. This is a big deal because Angular and the whole JavaScript ecosystem is moving towards ESM.
23
+
Vitest was designed with ECMAScript modules (ESM) compatibility in mind. This means that Vitest supports ESM out of the box. This is a big deal because Angular and the whole JavaScript ecosystem are moving towards ESM.
24
24
25
25
Beyond all the intrinsic advantages of ESM, **this means that Vitest does not require any configuration to downgrade ESM to CommonJS**, even for third-party libraries.
26
26
@@ -174,7 +174,7 @@ Here is a non-exhaustive list:
174
174
175
175
### Type Testing
176
176
177
-
Vitest supports [type testing](https://vitest.dev/guide/testing-types.html) out of the box. This means that intead of compilation errors using TypeScript's [`@ts-expect-error`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-9.html#-ts-expect-error-comments), you can write type tests for your complex generics, conditional types, and more using a similar API to your regular tests.
177
+
Vitest supports [type testing](https://vitest.dev/guide/testing-types.html) out of the box. This means that instead of compilation errors using TypeScript's [`@ts-expect-error`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-9.html#-ts-expect-error-comments), you can write type tests for your complex generics, conditional types, and more using a similar API to your regular tests.
178
178
179
179
```ts
180
180
test('create a serializer for the provided type', () => {
0 commit comments