Skip to content

Commit 1b9c8b0

Browse files
committed
01/01: add readme
1 parent 0234b54 commit 1b9c8b0

File tree

1 file changed

+13
-3
lines changed
  • exercises/01.sunsetting-jsdom/01.problem.break-jsdom

1 file changed

+13
-3
lines changed
Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# Break JSDOM
22

3-
0. You have a tiny React app with Vite.
4-
1. Install Vitest and JSDOM, and write a basic integration test for your React component.
5-
1. Run it to see it _failing_ even on this simple test.
3+
Before we talk about in-browser component testing, let's start with something familiar.
4+
5+
In this exercise, you have a simple React application that previews the files you upload from your computer. To do that, it has a `type="file"` input and reads the content of the chosen file to display it for the user.
6+
7+
You can run and play around with the application using this command:
8+
9+
```sh
10+
npm run dev
11+
```
12+
13+
Of course, like any quality software, this file preview app could use some automated tests. A great way to approach this is by introducing a test for the `<FilePreview />` component.
14+
15+
👨‍💼 This is where you come in. Follow the instructions in `file-preview.test.tsx` and complete the first automated test for this component. Try running it via `npm test` but don't be discouraged if it suddenly _fails_.

0 commit comments

Comments
 (0)