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
+4-7Lines changed: 4 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,7 +30,7 @@ Then, from the `extensions/ql-vscode` directory, use the appropriate command to
30
30
* View Tests: `npm test:view`
31
31
* VSCode integration tests: `npm run test:vscode-integration`
32
32
33
-
#### CLI integration tests
33
+
#### Running CLI integration tests from the terminal
34
34
35
35
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.
36
36
@@ -52,8 +52,7 @@ You will need to run tests using a task from inside of VS Code, under the "Run a
52
52
* View Tests: run the _Launch Unit Tests_ task
53
53
* VSCode integration tests: run the _Launch Unit Tests - No Workspace_ and _Launch Unit Tests - Minimal Workspace_ tasks
54
54
55
-
<!-- markdownlint-disable-next-line MD024 -->
56
-
#### CLI integration tests
55
+
#### Running CLI integration tests from VSCode
57
56
58
57
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.
59
58
@@ -65,8 +64,7 @@ The CLI integration tests require the CodeQL standard libraries in order to run
65
64
66
65
## Running a single test
67
66
68
-
<!-- markdownlint-disable-next-line MD024 -->
69
-
### 1. From the terminal
67
+
### 1. Running a single test from the terminal
70
68
71
69
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
72
70
to only run tests for this specific file. For example, to run the test `test/vscode-tests/cli-integration/run-queries.test.ts`:
@@ -81,8 +79,7 @@ You can also use the `--testNamePattern` option to run a specific test within a
81
79
npm run test:cli-integration -- --runTestsByPath test/vscode-tests/cli-integration/run-queries.test.ts --testNamePattern "should create a QueryEvaluationInfo"
82
80
```
83
81
84
-
<!-- markdownlint-disable-next-line MD024 -->
85
-
### 2. From VSCode
82
+
### 2. Running a single test from VSCode
86
83
87
84
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,
88
85
you will have quicklinks to run a single test from within test files. To run a single unit or integration test, click the "Run" button. Debugging a single test is currently only supported
0 commit comments