|
9 | 9 | - [Updating VS Code](#updating-vs-code)
|
10 | 10 | - [Notes about Changes](#notes-about-changes)
|
11 | 11 | - [Build](#build)
|
| 12 | +- [Testing](#testing) |
| 13 | + - [Unit Tests](#unit-tests) |
| 14 | + - [Integration Tests](#integration-tests) |
| 15 | + - [End-to-End Tests](#end-to-end-tests) |
12 | 16 | - [Structure](#structure)
|
13 | 17 | - [Modifications to VS Code](#modifications-to-vs-code)
|
14 | 18 | - [Currently Known Issues](#currently-known-issues)
|
@@ -112,6 +116,37 @@ In our GitHub Actions CI, we use CentOS 7 for maximum compatibility.
|
112 | 116 | If you need your builds to support older distros, run the build commands
|
113 | 117 | inside a Docker container with all the build requirements installed.
|
114 | 118 |
|
| 119 | +## Testing |
| 120 | + |
| 121 | +There are three kinds of tests in code-server: |
| 122 | + |
| 123 | +1. unit tests |
| 124 | +2. integration tests |
| 125 | +3. end-to-end tests |
| 126 | + |
| 127 | +### Unit Tests |
| 128 | + |
| 129 | +Our unit tests are written in TypeScript and run using [Jest](https://jestjs.io/). |
| 130 | + |
| 131 | +These live under [test/unit](../test/unit). |
| 132 | + |
| 133 | +### Integration Tests |
| 134 | + |
| 135 | +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) |
| 136 | +which ensures that code-server's CLI is working. |
| 137 | + |
| 138 | +### End-to-End Tests |
| 139 | + |
| 140 | +The end-to-end (e2e) are written in TypeScript and run using [Playwright](https://playwright.dev/). |
| 141 | + |
| 142 | +These live under [test/e2e](../test/e2e). |
| 143 | + |
| 144 | +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. |
| 145 | + |
| 146 | +Take a look at `codeServer.test.ts` to see how you use it (look at `test.use`). |
| 147 | + |
| 148 | +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. |
| 149 | + |
115 | 150 | ## Structure
|
116 | 151 |
|
117 | 152 | The `code-server` script serves an HTTP API for login and starting a remote VS Code process.
|
|
0 commit comments