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
Copy file name to clipboardExpand all lines: docs/testing.md
+8Lines changed: 8 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,6 +18,7 @@ Any test data you're using (sample projects, config files, etc.) must go in a `t
18
18
## Running the tests
19
19
20
20
Pre-requisites:
21
+
21
22
1. Run `npm run build`.
22
23
2. You will need to have `npm run watch` running in the background.
23
24
@@ -51,6 +52,7 @@ You will need to run tests using a task from inside of VS Code, under the "Run a
51
52
* View Tests: run the _Launch Unit Tests_ task
52
53
* VSCode integration tests: run the _Launch Unit Tests - No Workspace_ and _Launch Unit Tests - Minimal Workspace_ tasks
53
54
55
+
<!-- markdownlint-disable-next-line MD024 -->
54
56
#### CLI integration tests
55
57
56
58
The CLI integration tests require the CodeQL standard libraries in order to run so you will need to clone a local copy of the `github/codeql` repository.
@@ -63,6 +65,7 @@ The CLI integration tests require the CodeQL standard libraries in order to run
63
65
64
66
## Running a single test
65
67
68
+
<!-- markdownlint-disable-next-line MD024 -->
66
69
### 1. From the terminal
67
70
68
71
The easiest way to run a single test is to change the `it` of the test to `it.only` and then run the test command with some additional options
@@ -78,6 +81,7 @@ You can also use the `--testNamePattern` option to run a specific test within a
78
81
npm run test:cli-integration -- --runTestsByPath test/vscode-tests/cli-integration/run-queries.test.ts --testNamePattern "should create a QueryEvaluationInfo"
79
82
```
80
83
84
+
<!-- markdownlint-disable-next-line MD024 -->
81
85
### 2. From VSCode
82
86
83
87
Alternatively, you can run a single test inside VSCode. To do so, install the [Jest Runner](https://marketplace.visualstudio.com/items?itemName=firsttris.vscode-jest-runner) extension. Then,
@@ -94,7 +98,9 @@ Multi-Repo Variant Analyses (MRVA) rely on the GitHub API. In order to make deve
94
98
### Using a pre-recorded test scenario
95
99
96
100
To run a mock MRVA scenario, follow these steps:
101
+
97
102
1. Enable the mock GitHub API server by adding the following in your VS Code user settings (which can be found by running the `Preferences: Open User Settings (JSON)` VS Code command):
103
+
98
104
```json
99
105
"codeQL.mockGitHubApiServer": {
100
106
"enabled": true
@@ -108,9 +114,11 @@ To run a mock MRVA scenario, follow these steps:
108
114
If you want to replay the same scenario you should unload and reload it so requests are replayed from the start.
109
115
110
116
### Recording a new test scenario
117
+
111
118
To record a new mock MRVA scenario, follow these steps:
112
119
113
120
1. Enable the mock GitHub API server by adding the following in your VS Code user settings (which can be found by running the `Preferences: Open User Settings (JSON)` VS Code command):
0 commit comments