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: dev.md
+29-1
Original file line number
Diff line number
Diff line change
@@ -1,11 +1,39 @@
1
1
# Development documentation
2
2
3
-
### Architecture
3
+
## Testing
4
+
5
+
The project started without any automated testing because we didn't looked at ink-testing-library and we tested manually. The current state of the project is that is mostly untested automatically and somewhat tested manually. Later, I setup some abstractions and configurations to use ink-testing-library fully, this wasn't easy and not totally done (the store is not reset between e2e tests causing fails).
6
+
7
+
I started doing 2-3 e2e tests and some component testing for the new `PartialList.tsx` ! But we clearly need to have a lot more e2e tests to cover main feature like watch mode, search, help, browsing exos, exo details display... If you want to contribute some to make it more stable or as a bug reproduction you are more than welcome ! I'm going to write them as I change things or fix bugs.
8
+
9
+
All tests are present inside `tests/`. We are using Vitest and a few abstractions in `tests/utils/helpers.ts`.
10
+
11
+
**Running all tests**
12
+
```sh
13
+
pnpm test
14
+
```
15
+
**Running all tests and stop**
16
+
```sh
17
+
pnpm test --run
18
+
```
19
+
20
+
**Running a single test file**
21
+
```sh
22
+
pnpm test tests/PartialList.test.ts
23
+
```
24
+
25
+
**Tips for writing tests - IMPORTANT**
26
+
1. Easily type shortcuts by using `type()`. If you give several letters like `type("jjk")` it will type them one after the other with a short wait timing to simulate a real keyboard and make the shortcuts system consider them indepedant.
27
+
1. Before entering any input via `type()`, call once `await waitForInputsToBeReady();` at the start of the test
28
+
1. If tests are eating more and more RAM, check if the store might not be closed on component unmount and this would cause to block the exit...
0 commit comments