|
1 |
| -# Rstest VS Code Extension |
| 1 | +# Rstest VS Code extension |
2 | 2 |
|
3 |
| -A VS Code extension that discovers and runs tests for your project. |
| 3 | +Rstest is a VS Code extension that discovers, displays, and runs tests in your workspace. It builds a rich Test Explorer tree from your test files and keeps it up to date as files change. |
4 | 4 |
|
5 |
| -## Configuration |
6 |
| - |
7 |
| -The extension reads settings with the following priority: |
| 5 | +## Features |
8 | 6 |
|
9 |
| -1. Workspace Folder |
10 |
| -2. Workspace |
11 |
| -3. User |
12 |
| -4. Default |
| 7 | +- Discovers test files via configurable glob patterns |
| 8 | +- Parses test structure to build a nested tree (describe/suite/test) |
| 9 | +- Runs individual tests, suites, or entire files |
| 10 | +- Watches the filesystem and updates the tree on create/change/delete |
13 | 11 |
|
14 |
| -| Setting | Type | Scope | Default | Description | |
15 |
| -| ---------------------------- | ------------------ | -------- | -------------------------------- | ------------------------------------------------------------- | |
16 |
| -| `rstest.testFileGlobPattern` | string[] | Resource | `["**/*.test.*", "**/*.spec.*"]` | Glob pattern(s) used to discover test files in the workspace. | |
| 12 | +## Activation |
17 | 13 |
|
18 |
| -Notes |
| 14 | +The extension activates automatically when your workspace contains Rstest configuration files (e.g., `rstest.config.*`, `rstest.workspace.*`, `rstest.projects.*`). On activation, it eagerly scans the workspace and populates the Test Explorer. |
19 | 15 |
|
20 |
| -- Must be an array of strings. |
21 |
| -- Applied per workspace folder when set at the folder level. |
22 |
| - |
23 |
| -### Examples |
| 16 | +## Configuration |
24 | 17 |
|
25 |
| -settings.json (User/Workspace): |
| 18 | +| Setting | Type | Scope | Default | Description | |
| 19 | +| ---------------------------- | -------- | -------- | -------------------------------- | ------------------------------------------------------------- | |
| 20 | +| `rstest.testFileGlobPattern` | string[] | Resource | `["**/*.test.*", "**/*.spec.*"]` | Glob pattern(s) used to discover test files in the workspace. | |
26 | 21 |
|
27 |
| -```json |
28 |
| -{ |
29 |
| - "rstest.testFileGlobPattern": ["**/*.test.ts", "**/*.spec.tsx"] |
30 |
| -} |
31 |
| -``` |
| 22 | +## How it Works |
32 | 23 |
|
33 |
| -Per-folder override (settings.json in a specific folder): |
| 24 | +- On activation, the extension scans for test files using `rstest.testFileGlobPattern` and creates a Test Explorer tree. |
| 25 | +- File system watchers keep the tree synchronized as files are created, modified, or deleted. |
| 26 | +- Test content is parsed to identify nested suites and tests so you can run them granularly. |
34 | 27 |
|
35 |
| -```json |
36 |
| -{ |
37 |
| - "rstest.testFileGlobPattern": ["apps/web/**/*.test.ts"] |
38 |
| -} |
39 |
| -``` |
| 28 | +## Development |
40 | 29 |
|
41 |
| -## How it works |
| 30 | +Common commands (run from this package): |
42 | 31 |
|
43 |
| -- On activation, the extension eagerly scans for test files using `rstest.testFileGlobPattern` and populates the Test Explorer tree. |
44 |
| -- File system watchers keep the tree in sync as files are created/changed/deleted. |
45 |
| -- Tests are parsed to build a nested tree using the file contents. |
| 32 | +- `npm run build` — Build with rslib |
| 33 | +- `npm run watch` — Rebuild on change |
| 34 | +- `npm run typecheck` — TypeScript noEmit check |
| 35 | +- `npm run test:unit` — Unit tests via Rstest |
| 36 | +- `npm run test:e2e` — VS Code Extension Host E2E tests |
0 commit comments