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
Outline relies on tests to ensure that changes don't break anything, using a mix of unit and end-to-end tests.
4
+
5
+
## Unit tests
6
+
7
+
We use Jest to run unit tests in core (`outline` package). The goal is to have a well tested API, enabling us to add or modify features without breaking it.
8
+
9
+
To run the tests use:
10
+
11
+
```
12
+
npm run test-unit
13
+
```
14
+
15
+
Unit tests can be found in [this directory](/packages/outline/src/__tests__).
16
+
17
+
## End-to-end (E2E) tests
18
+
19
+
We use [Playwright](https://playwright.dev/) for running E2E tests in Chromium, Firefox and WebKit.
20
+
21
+
These tests run in the `outline-playground` package and are divided into proactive and reactive tests (`e2e` and `regression` directories).
22
+
23
+
The goal for this type of test is to validate the behavior of Outline in a browser, without necessarily knowing how the internals work.
24
+
25
+
To run E2E tests use:
26
+
27
+
```
28
+
npm run start &
29
+
npm run test-e2e:chromium # or :firefox, :webkit
30
+
```
31
+
32
+
E2E tests can be found in [this directory](/packages/outline-playground/__tests__)
33
+
34
+
## General guidelines
35
+
36
+
When writing tests, please follow these practices:
37
+
38
+
- New features must include tests.
39
+
- No test is too small or too big to be included. If it can break, add a test.
40
+
- Do not merge pull requests with failing tests, this can block other people and releases.
41
+
- Be mindful with your abstractions: sometimes it's convenient to create abstractions/utils to make test files smaller and less repetitive. Please make sure that they are simple and easy to follow.
0 commit comments