Skip to content

Commit 835aa5c

Browse files
author
Antoine Tremblay
committed
Document testing theia
Signed-off-by: Antoine Tremblay <[email protected]>
1 parent 74593ca commit 835aa5c

File tree

3 files changed

+46
-1
lines changed

3 files changed

+46
-1
lines changed

.npmignore

+4-1
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,7 @@ lerna-debug.log
99
.nyc_output
1010
coverage
1111
.browser_modules
12-
download
12+
download
13+
*ui-spec.ts
14+
*slow-spec.ts
15+
test-resources

doc/Developing.md

+4
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,10 @@ Note that we should be able to debug both frontend and backend in one window but
122122
[this issue](https://github.com/Microsoft/vscode/issues/28817) when trying
123123
that. tl;dr Some breakpoints don't hit.
124124

125+
## Testing
126+
127+
See the [testing](Testing.md) documentation.
128+
125129
## tl;dr
126130

127131
To build and run the browser example:

doc/Testing.md

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Testing
2+
3+
## Running tests
4+
5+
To run tests on theia run:
6+
7+
`yarn test`
8+
9+
This will run all CI enabled tests.
10+
11+
## Test directory structure
12+
13+
The test directory structure is as follows:
14+
15+
- `src/node/foo.ts`: Code to be tested.
16+
- `src/node/foo.spec.ts`: Unit tests for foo.ts.
17+
- `src/node/test/test-helper.ts`: Any mocks, fixture or utility test code
18+
goes here.
19+
- `src/node/foo.slow-spec.ts`: Any slow running tests such as integration
20+
tests should be labeled as such so that they can be excluded.
21+
- `src/browser/foo.ui-spec.ts`: UI tests.
22+
- `test-resources`: Any resources needed for the tests like configuration
23+
files or scripts.
24+
- `test-resources/ui`: Resources for UI testing.
25+
- `test-resources/slow`: Resources for slow running tests.
26+
27+
## Publishing
28+
29+
### Published test files
30+
31+
Unit tests named as `foo.spec.ts` will be published since they're also for
32+
documentation purposes.
33+
34+
### Unpublished
35+
36+
- `*ui-spec.ts`
37+
- `*slow-spec.ts`
38+
- `test-resources`

0 commit comments

Comments
 (0)