|
1 | 1 | <!-- START doctoc generated TOC please keep comment here to allow auto update -->
|
2 | 2 | <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
| 3 | + |
3 | 4 | # Contributing
|
4 | 5 |
|
5 | 6 | - [Pull Requests](#pull-requests)
|
@@ -112,6 +113,37 @@ In our GitHub Actions CI, we use CentOS 7 for maximum compatibility.
|
112 | 113 | If you need your builds to support older distros, run the build commands
|
113 | 114 | inside a Docker container with all the build requirements installed.
|
114 | 115 |
|
| 116 | +## Testing |
| 117 | + |
| 118 | +There are three kinds of tests in code-server: |
| 119 | + |
| 120 | +1. unit tests |
| 121 | +2. integration tests |
| 122 | +3. end-to-end tests |
| 123 | + |
| 124 | +### Unit Tests |
| 125 | + |
| 126 | +Our unit tests are written in TypeScript and run using [Jest](https://jestjs.io/). |
| 127 | + |
| 128 | +These live under [test/unit](../test/unit). |
| 129 | + |
| 130 | +### Integration Tests |
| 131 | + |
| 132 | +These are a work-in-progress. We build code-server a run a script called [test-standalone-release.sh`](../ci/build/test-standalone-release.sh) |
| 133 | +which ensures that code-server's CLI is working. |
| 134 | + |
| 135 | +### End-to-End Tests |
| 136 | + |
| 137 | +The end-to-end (e2e) are written in TypeScript and run using [Playwright](https://playwright.dev/). |
| 138 | + |
| 139 | +These live under [test/e2e](../test/e2e). |
| 140 | + |
| 141 | +Before the e2e tests run, we have a `globalSetup` that runs which makes it so you don't have to login before each test and can reuse the authentication state. |
| 142 | + |
| 143 | +Take a look at `codeServer.test.ts` to see how you use it (look at `test.use`). |
| 144 | + |
| 145 | +We also have a model where you can create helpers to use within tests. Take a look at [models/CodeServer.ts](../test/e2e/models/CodeServer.ts) to see an example. |
| 146 | + |
115 | 147 | ## Structure
|
116 | 148 |
|
117 | 149 | The `code-server` script serves an HTTP API for login and starting a remote VS Code process.
|
|
0 commit comments