Skip to content

Commit d6bc68a

Browse files
committed
docs(contr): add section on testing
1 parent bf45e7c commit d6bc68a

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ VS Code v0.00.0
6060
- chore: update node to v14 #3458 @oxy
6161
- chore: update .gitignore #3557 @cuining
6262
- fix: use sufficient computational effort for password hash #3422 @jsjoeio
63+
- docs(CONTRIBUTING): add section on testing #3629 @jsjoeio
6364

6465
### Development
6566

docs/CONTRIBUTING.md

+35
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
- [Updating VS Code](#updating-vs-code)
1010
- [Notes about Changes](#notes-about-changes)
1111
- [Build](#build)
12+
- [Testing](#testing)
13+
- [Unit Tests](#unit-tests)
14+
- [Integration Tests](#integration-tests)
15+
- [End-to-End Tests](#end-to-end-tests)
1216
- [Structure](#structure)
1317
- [Modifications to VS Code](#modifications-to-vs-code)
1418
- [Currently Known Issues](#currently-known-issues)
@@ -112,6 +116,37 @@ In our GitHub Actions CI, we use CentOS 7 for maximum compatibility.
112116
If you need your builds to support older distros, run the build commands
113117
inside a Docker container with all the build requirements installed.
114118

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+
115150
## Structure
116151

117152
The `code-server` script serves an HTTP API for login and starting a remote VS Code process.

0 commit comments

Comments
 (0)