Skip to content

Commit 22e9494

Browse files
authored
Fix 5c typos
The test file must have .jsx file extension for Vitest to recognize React components
1 parent e4150e8 commit 22e9494

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/content/5/en/part5c.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ The course previously used the [Jest](http://jestjs.io/) library developed by Fa
2020
Let's start by installing Vitest and the [jsdom](https://github.com/jsdom/jsdom) library simulating a web browser:
2121

2222
```
23-
npm install --save-vitest vitest jsdom
23+
npm install --save-dev vitest jsdom
2424
```
2525

2626
In addition to Vitest, we also need another testing library that will help us render components for testing purposes. The current best option for this is [react-testing-library](https://github.com/testing-library/react-testing-library) which has seen rapid growth in popularity in recent times. It is also worth extending the expressive power of the tests with the library [jest-dom](https://github.com/testing-library/jest-dom).
@@ -95,7 +95,7 @@ Notice that the <i>li</i> element has the value <i>note</i> for the [CSS](https:
9595

9696
### Rendering the component for tests
9797

98-
We will write our test in the <i>src/components/Note.test.js</i> file, which is in the same directory as the component itself.
98+
We will write our test in the <i>src/components/Note.test.jsx</i> file, which is in the same directory as the component itself.
9999

100100
The first test verifies that the component renders the contents of the note:
101101

0 commit comments

Comments
 (0)