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
|---- server.ts [default Express server configuration]
20
+
```
21
+
22
+
The tests are grouped by their scopes, such as `public-api` or `tracing`. In every group of tests, there are multiple folders containing test scenarios and assertions.
23
+
24
+
Tests run on Express servers (a server instance per test). By default, a simple server template inside `utils/defaults/server.ts` is used. Every server instance runs on a different port.
25
+
26
+
A custom server configuration can be used, supplying a script that exports a valid express server instance as default. `runServer` utility function accepts an optional `serverPath` argument for this purpose.
27
+
28
+
`scenario.ts` contains the initialization logic and the test subject. By default, `{TEST_DIR}/scenario.ts` is used, but `runServer` also accepts an optional `scenarioPath` argument for non-standard usage.
29
+
30
+
`test.ts` is required for each test case, and contains the server runner logic, request interceptors for Sentry requests, and assertions. Test server, interceptors and assertions are all run on the same Jest thread.
31
+
32
+
### Utilities
33
+
34
+
`utils/` contains helpers and Sentry-specific assertions that can be used in (`test.ts`).
35
+
36
+
## Running Tests Locally
37
+
38
+
Tests can be run locally with:
39
+
40
+
`yarn test`
41
+
42
+
To run tests with Jest's watch mode:
43
+
44
+
`yarn test:jest`
45
+
46
+
To filter tests by their title:
47
+
48
+
`yarn test -t "set different properties of a scope"`
49
+
50
+
You can refer to [Jest documentation](https://jestjs.io/docs/cli) for other CLI options.
0 commit comments