Skip to content

Commit b4bf225

Browse files
committed
feat: add VS Code extension
docs: add Repository Guidelines in AGENTS.md test-run: iterate all test results and map to corresponding TestItems for TestCase runs (remove testResults[0] usage) fixed refactor(extension): delegate TestCase/TestFile run logic to testTree classes without changing behavior\n\n- Add gatherTestItems helper to testTree.ts\n- Implement TestFile.run mirroring file-level run logic\n- Implement TestCase.run mirroring case-level run logic\n- Replace duplicated branches in extension.ts with class method calls test(e2e): update expected label tree for fixtures/test/foo.test.ts changes (l1/l2/l3 structure and additional cases) feat: inform user continuous run is not implemented and no-op on watch requests feat(discovery): support common test patterns (*.test.*, *.spec.*)\n\n- Watch and discover **/*.test.* and **/*.spec.*\n- Update open/change handler to process files matching these patterns\n- Keep behavior unchanged otherwise feat(vscode): eagerly scan all test files on init to populate test tree - Add scanAllTestFiles() in src/testTree.ts to find **/*.test.* and **/*.spec.* across workspace, create root TestItems, and parse contents to build children. - Invoke scanAllTestFiles() in extension constructor and on root resolve to ensure the TestController includes all tests without opening files. - Keep existing FS watchers for incremental updates. 1 add config test
1 parent b4e8782 commit b4bf225

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+3313
-94
lines changed

.github/workflows/test.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,3 +113,7 @@ jobs:
113113
- name: E2E Test
114114
if: steps.changes.outputs.changed == 'true'
115115
run: pnpm run e2e
116+
117+
- name: VS Code Extension Test
118+
if: steps.changes.outputs.changed == 'true'
119+
run: pnpm run test:vscode

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ test-temp-*
2323
.vscode/**/*
2424
!.vscode/settings.json
2525
!.vscode/extensions.json
26+
!.vscode/launch.json
27+
!.vscode/tasks.json
2628
.idea/
2729
.nx/
2830
.history/
@@ -34,3 +36,5 @@ test-results/
3436
fixtures-test/
3537
fixtures-test-*/
3638
.rslib/
39+
tests-dist/
40+
.vscode-test/

.vscode/launch.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// A launch configuration that compiles the extension and then opens it inside a new window
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
{
6+
"version": "0.2.0",
7+
"configurations": [
8+
{
9+
"name": "Run Extension",
10+
"type": "extensionHost",
11+
"request": "launch",
12+
"runtimeExecutable": "${execPath}",
13+
"args": [
14+
"--extensionDevelopmentPath=${workspaceFolder}/packages/vscode",
15+
"${workspaceFolder}/packages/vscode/sample"
16+
],
17+
"outFiles": ["${workspaceFolder}/packages/vscode/dist/**/*.js"],
18+
"preLaunchTask": "npm: build:local"
19+
}
20+
]
21+
}

.vscode/tasks.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// See https://go.microsoft.com/fwlink/?LinkId=733558
2+
// for the documentation about the tasks.json format
3+
{
4+
"version": "2.0.0",
5+
"tasks": [
6+
{
7+
"type": "npm",
8+
"script": "build:local",
9+
"path": "packages/vscode",
10+
"problemMatcher": "$tsc-watch",
11+
"isBackground": true,
12+
"presentation": {
13+
"reveal": "never"
14+
},
15+
"group": {
16+
"kind": "build",
17+
"isDefault": true
18+
}
19+
}
20+
]
21+
}

biome.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$schema": "https://biomejs.dev/schemas/2.2.0/schema.json",
2+
"$schema": "https://biomejs.dev/schemas/2.2.2/schema.json",
33
"assist": { "actions": { "source": { "organizeImports": "on" } } },
44
"vcs": {
55
"enabled": true,
@@ -9,7 +9,13 @@
99
},
1010
"files": {
1111
"ignoreUnknown": true,
12-
"includes": ["**", "!**/*.vue", "!**/dist", "!**/dist-types"]
12+
"includes": [
13+
"**",
14+
"!**/*.vue",
15+
"!**/dist",
16+
"!**/dist-types",
17+
"!**/.vscode-test.mjs"
18+
]
1319
},
1420
"formatter": {
1521
"indentStyle": "space"

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"scripts": {
55
"typecheck": "cross-env NX_DAEMON=false nx run-many -t typecheck --exclude @examples/* --parallel=10",
66
"build": "cross-env NX_DAEMON=false nx run-many -t build --exclude @examples/* @rstest/tests-* --parallel=10",
7+
"test:vscode": "pnpm --filter ./packages/vscode test",
78
"e2e": "cd e2e && pnpm test",
89
"test": "rstest",
910
"change": "changeset",

packages/core/LICENSE.md

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -390,30 +390,6 @@ Licensed under MIT license in the repository at https://github.com/jestjs/jest.g
390390
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
391391
> SOFTWARE.
392392
393-
### @jridgewell/trace-mapping
394-
395-
Licensed under MIT license in the repository at git+https://github.com/jridgewell/sourcemaps.git.
396-
397-
> Copyright 2024 Justin Ridgewell <[email protected]>
398-
>
399-
> Permission is hereby granted, free of charge, to any person obtaining a copy
400-
> of this software and associated documentation files (the "Software"), to deal
401-
> in the Software without restriction, including without limitation the rights
402-
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
403-
> copies of the Software, and to permit persons to whom the Software is
404-
> furnished to do so, subject to the following conditions:
405-
>
406-
> The above copyright notice and this permission notice shall be included in
407-
> all copies or substantial portions of the Software.
408-
>
409-
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
410-
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
411-
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
412-
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
413-
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
414-
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
415-
> SOFTWARE.
416-
417393
### @sinonjs/commons
418394

419395
Licensed under BSD-3-Clause license in the repository at git+https://github.com/sinonjs/commons.git.
@@ -928,20 +904,6 @@ Licensed under MIT license in the repository at git+https://github.com/errwischt
928904
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
929905
> SOFTWARE.
930906
931-
### strip-ansi
932-
933-
Licensed under MIT license.
934-
935-
> MIT License
936-
>
937-
> Copyright (c) Sindre Sorhus <[email protected]> (https://sindresorhus.com)
938-
>
939-
> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
940-
>
941-
> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
942-
>
943-
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
944-
945907
### supports-color
946908

947909
Licensed under MIT license.

packages/core/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@
2828
"types": "./dist-types/index.d.ts",
2929
"default": "./dist/index.js"
3030
},
31+
"./package.json": {
32+
"default": "./package.json"
33+
},
3134
"./globals": {
3235
"types": "./globals.d.ts"
3336
},

packages/core/src/core/plugins/mockLoader.mjs

Whitespace-only changes.

packages/core/src/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import type { RstestConfig } from './types';
22

33
export { runCLI } from './cli';
4-
export { mergeRstestConfig } from './config';
4+
export { loadConfig, mergeRstestConfig } from './config';
5+
export { createRstest } from './core';
6+
57
export * from './runtime/api/public';
68

79
export type { RstestConfig };

0 commit comments

Comments
 (0)