@theia/test 1.45.1 → 1.46.0-next.72

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/lib/browser/constants.d.ts +45 -45
  2. package/lib/browser/constants.js +17 -17
  3. package/lib/browser/test-service.d.ts +154 -154
  4. package/lib/browser/test-service.js +247 -247
  5. package/lib/browser/view/test-context-key-service.d.ts +7 -7
  6. package/lib/browser/view/test-context-key-service.js +51 -51
  7. package/lib/browser/view/test-execution-state-manager.d.ts +13 -13
  8. package/lib/browser/view/test-execution-state-manager.js +173 -173
  9. package/lib/browser/view/test-output-ui-model.d.ts +47 -47
  10. package/lib/browser/view/test-output-ui-model.js +151 -151
  11. package/lib/browser/view/test-output-view-contribution.d.ts +5 -5
  12. package/lib/browser/view/test-output-view-contribution.js +47 -47
  13. package/lib/browser/view/test-output-widget.d.ts +24 -24
  14. package/lib/browser/view/test-output-widget.js +158 -158
  15. package/lib/browser/view/test-result-view-contribution.d.ts +5 -5
  16. package/lib/browser/view/test-result-view-contribution.js +47 -47
  17. package/lib/browser/view/test-result-widget.d.ts +20 -20
  18. package/lib/browser/view/test-result-widget.js +108 -108
  19. package/lib/browser/view/test-run-view-contribution.d.ts +17 -17
  20. package/lib/browser/view/test-run-view-contribution.js +100 -100
  21. package/lib/browser/view/test-run-widget.d.ts +58 -58
  22. package/lib/browser/view/test-run-widget.js +310 -310
  23. package/lib/browser/view/test-tree-widget.d.ts +67 -67
  24. package/lib/browser/view/test-tree-widget.js +386 -386
  25. package/lib/browser/view/test-view-contribution.d.ts +45 -45
  26. package/lib/browser/view/test-view-contribution.js +288 -288
  27. package/lib/browser/view/test-view-frontend-module.d.ts +6 -6
  28. package/lib/browser/view/test-view-frontend-module.js +121 -121
  29. package/lib/common/collections.d.ts +46 -46
  30. package/lib/common/collections.js +210 -210
  31. package/lib/common/tree-delta.d.ts +51 -51
  32. package/lib/common/tree-delta.js +240 -240
  33. package/lib/common/tree-delta.spec.d.ts +1 -1
  34. package/lib/common/tree-delta.spec.js +139 -139
  35. package/package.json +8 -8
  36. package/src/browser/constants.ts +71 -71
  37. package/src/browser/style/index.css +41 -41
  38. package/src/browser/test-service.ts +355 -355
  39. package/src/browser/view/test-context-key-service.ts +36 -36
  40. package/src/browser/view/test-execution-state-manager.ts +147 -147
  41. package/src/browser/view/test-output-ui-model.ts +156 -156
  42. package/src/browser/view/test-output-view-contribution.ts +34 -34
  43. package/src/browser/view/test-output-widget.ts +148 -148
  44. package/src/browser/view/test-result-view-contribution.ts +34 -34
  45. package/src/browser/view/test-result-widget.ts +92 -92
  46. package/src/browser/view/test-run-view-contribution.ts +89 -89
  47. package/src/browser/view/test-run-widget.tsx +271 -271
  48. package/src/browser/view/test-tree-widget.tsx +360 -360
  49. package/src/browser/view/test-view-contribution.ts +300 -300
  50. package/src/browser/view/test-view-frontend-module.ts +134 -134
  51. package/src/common/collections.ts +223 -223
  52. package/src/common/tree-delta.spec.ts +166 -166
  53. package/src/common/tree-delta.ts +259 -259
@@ -1,46 +1,46 @@
1
- export declare const enum Testing {
2
- ViewletId = "workbench.view.extension.test",
3
- ExplorerViewId = "workbench.view.testing",
4
- OutputPeekContributionId = "editor.contrib.testingOutputPeek",
5
- DecorationsContributionId = "editor.contrib.testingDecorations"
6
- }
7
- export declare const enum TestCommandId {
8
- CancelTestRefreshAction = "testing.cancelTestRefresh",
9
- CancelTestRunAction = "testing.cancelRun",
10
- ClearTestResultsAction = "testing.clearTestResults",
11
- CollapseAllAction = "testing.collapseAll",
12
- ConfigureTestProfilesAction = "testing.configureProfile",
13
- DebugAction = "testing.debug",
14
- DebugAllAction = "testing.debugAll",
15
- DebugAtCursor = "testing.debugAtCursor",
16
- DebugCurrentFile = "testing.debugCurrentFile",
17
- DebugFailedTests = "testing.debugFailTests",
18
- DebugLastRun = "testing.debugLastRun",
19
- DebugSelectedAction = "testing.debugSelected",
20
- FilterAction = "workbench.actions.treeView.testExplorer.filter",
21
- GoToTest = "testing.editFocusedTest",
22
- HideTestAction = "testing.hideTest",
23
- OpenOutputPeek = "testing.openOutputPeek",
24
- RefreshTestsAction = "testing.refreshTests",
25
- ReRunFailedTests = "testing.reRunFailTests",
26
- ReRunLastRun = "testing.reRunLastRun",
27
- RunAction = "testing.run",
28
- RunAllAction = "testing.runAll",
29
- RunAtCursor = "testing.runAtCursor",
30
- RunCurrentFile = "testing.runCurrentFile",
31
- RunSelectedAction = "testing.runSelected",
32
- RunUsingProfileAction = "testing.runUsing",
33
- SearchForTestExtension = "testing.searchForTestExtension",
34
- SelectDefaultTestProfiles = "testing.selectDefaultTestProfiles",
35
- ShowMostRecentOutputAction = "testing.showMostRecentOutput",
36
- TestingSortByDurationAction = "testing.sortByDuration",
37
- TestingSortByLocationAction = "testing.sortByLocation",
38
- TestingSortByStatusAction = "testing.sortByStatus",
39
- TestingViewAsListAction = "testing.viewAsList",
40
- TestingViewAsTreeAction = "testing.viewAsTree",
41
- ToggleAutoRun = "testing.toggleautoRun",
42
- ToggleInlineTestOutput = "testing.toggleInlineTestOutput",
43
- UnhideTestAction = "testing.unhideTest",
44
- UnhideAllTestsAction = "testing.unhideAllTests"
45
- }
1
+ export declare const enum Testing {
2
+ ViewletId = "workbench.view.extension.test",
3
+ ExplorerViewId = "workbench.view.testing",
4
+ OutputPeekContributionId = "editor.contrib.testingOutputPeek",
5
+ DecorationsContributionId = "editor.contrib.testingDecorations"
6
+ }
7
+ export declare const enum TestCommandId {
8
+ CancelTestRefreshAction = "testing.cancelTestRefresh",
9
+ CancelTestRunAction = "testing.cancelRun",
10
+ ClearTestResultsAction = "testing.clearTestResults",
11
+ CollapseAllAction = "testing.collapseAll",
12
+ ConfigureTestProfilesAction = "testing.configureProfile",
13
+ DebugAction = "testing.debug",
14
+ DebugAllAction = "testing.debugAll",
15
+ DebugAtCursor = "testing.debugAtCursor",
16
+ DebugCurrentFile = "testing.debugCurrentFile",
17
+ DebugFailedTests = "testing.debugFailTests",
18
+ DebugLastRun = "testing.debugLastRun",
19
+ DebugSelectedAction = "testing.debugSelected",
20
+ FilterAction = "workbench.actions.treeView.testExplorer.filter",
21
+ GoToTest = "testing.editFocusedTest",
22
+ HideTestAction = "testing.hideTest",
23
+ OpenOutputPeek = "testing.openOutputPeek",
24
+ RefreshTestsAction = "testing.refreshTests",
25
+ ReRunFailedTests = "testing.reRunFailTests",
26
+ ReRunLastRun = "testing.reRunLastRun",
27
+ RunAction = "testing.run",
28
+ RunAllAction = "testing.runAll",
29
+ RunAtCursor = "testing.runAtCursor",
30
+ RunCurrentFile = "testing.runCurrentFile",
31
+ RunSelectedAction = "testing.runSelected",
32
+ RunUsingProfileAction = "testing.runUsing",
33
+ SearchForTestExtension = "testing.searchForTestExtension",
34
+ SelectDefaultTestProfiles = "testing.selectDefaultTestProfiles",
35
+ ShowMostRecentOutputAction = "testing.showMostRecentOutput",
36
+ TestingSortByDurationAction = "testing.sortByDuration",
37
+ TestingSortByLocationAction = "testing.sortByLocation",
38
+ TestingSortByStatusAction = "testing.sortByStatus",
39
+ TestingViewAsListAction = "testing.viewAsList",
40
+ TestingViewAsTreeAction = "testing.viewAsTree",
41
+ ToggleAutoRun = "testing.toggleautoRun",
42
+ ToggleInlineTestOutput = "testing.toggleInlineTestOutput",
43
+ UnhideTestAction = "testing.unhideTest",
44
+ UnhideAllTestsAction = "testing.unhideAllTests"
45
+ }
46
46
  //# sourceMappingURL=constants.d.ts.map
@@ -1,18 +1,18 @@
1
- "use strict";
2
- // *****************************************************************************
3
- // Copyright (C) 2023 Mathieu Bussieres and others.
4
- //
5
- // This program and the accompanying materials are made available under the
6
- // terms of the Eclipse Public License v. 2.0 which is available at
7
- // http://www.eclipse.org/legal/epl-2.0.
8
- //
9
- // This Source Code may also be made available under the following Secondary
10
- // Licenses when the conditions for such availability set forth in the Eclipse
11
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
- // with the GNU Classpath Exception which is available at
13
- // https://www.gnu.org/software/classpath/license.html.
14
- //
15
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
16
- // *****************************************************************************
17
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2023 Mathieu Bussieres and others.
4
+ //
5
+ // This program and the accompanying materials are made available under the
6
+ // terms of the Eclipse Public License v. 2.0 which is available at
7
+ // http://www.eclipse.org/legal/epl-2.0.
8
+ //
9
+ // This Source Code may also be made available under the following Secondary
10
+ // Licenses when the conditions for such availability set forth in the Eclipse
11
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
+ // with the GNU Classpath Exception which is available at
13
+ // https://www.gnu.org/software/classpath/license.html.
14
+ //
15
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
16
+ // *****************************************************************************
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
18
  //# sourceMappingURL=constants.js.map
@@ -1,155 +1,155 @@
1
- import { CancellationToken, ContributionProvider, Disposable, Event, QuickPickService } from '@theia/core/lib/common';
2
- import { Location, Range } from '@theia/core/shared/vscode-languageserver-protocol';
3
- import { CollectionDelta, TreeDelta } from '../common/tree-delta';
4
- import { MarkdownString } from '@theia/core/lib/common/markdown-rendering';
5
- import URI from '@theia/core/lib/common/uri';
6
- export declare enum TestRunProfileKind {
7
- Run = 1,
8
- Debug = 2,
9
- Coverage = 3
10
- }
11
- export interface TestRunProfile {
12
- readonly kind: TestRunProfileKind;
13
- readonly label: string;
14
- readonly isDefault: boolean;
15
- readonly canConfigure: boolean;
16
- readonly tag: string;
17
- run(name: string, included: readonly TestItem[], excluded: readonly TestItem[]): void;
18
- configure(): void;
19
- }
20
- export interface TestOutputItem {
21
- readonly output: string;
22
- readonly location?: Location;
23
- }
24
- export declare enum TestExecutionState {
25
- Queued = 1,
26
- Running = 2,
27
- Passed = 3,
28
- Failed = 4,
29
- Skipped = 5,
30
- Errored = 6
31
- }
32
- export interface TestMessage {
33
- readonly expected?: string;
34
- readonly actual?: string;
35
- readonly location: Location;
36
- readonly message: string | MarkdownString;
37
- readonly contextValue?: string;
38
- }
39
- export declare namespace TestMessage {
40
- function is(obj: unknown): obj is TestMessage;
41
- }
42
- export interface TestState {
43
- readonly state: TestExecutionState;
44
- }
45
- export interface TestFailure extends TestState {
46
- readonly state: TestExecutionState.Failed | TestExecutionState.Errored;
47
- readonly messages: TestMessage[];
48
- readonly duration?: number;
49
- }
50
- export declare namespace TestFailure {
51
- function is(obj: unknown): obj is TestFailure;
52
- }
53
- export interface TestSuccess extends TestState {
54
- readonly state: TestExecutionState.Passed;
55
- readonly duration?: number;
56
- }
57
- export interface TestStateChangedEvent {
58
- test: TestItem;
59
- oldState: TestState | undefined;
60
- newState: TestState | undefined;
61
- }
62
- export interface TestRun {
63
- cancel(): void;
64
- readonly name: string;
65
- readonly isRunning: boolean;
66
- readonly controller: TestController;
67
- onDidChangeProperty: Event<{
68
- name?: string;
69
- isRunning?: boolean;
70
- }>;
71
- getTestState(item: TestItem): TestState | undefined;
72
- onDidChangeTestState: Event<TestStateChangedEvent[]>;
73
- getOutput(item?: TestItem): readonly TestOutputItem[];
74
- onDidChangeTestOutput: Event<[TestItem | undefined, TestOutputItem][]>;
75
- readonly items: readonly TestItem[];
76
- }
77
- export declare namespace TestRun {
78
- function is(obj: unknown): obj is TestRun;
79
- }
80
- export interface TestItem {
81
- readonly id: string;
82
- readonly label: string;
83
- readonly range?: Range;
84
- readonly sortKey?: string;
85
- readonly tags: string[];
86
- readonly uri?: URI;
87
- readonly busy: boolean;
88
- readonly tests: readonly TestItem[];
89
- readonly description?: string;
90
- readonly error?: string | MarkdownString;
91
- readonly parent: TestItem | undefined;
92
- readonly controller: TestController | undefined;
93
- readonly canResolveChildren: boolean;
94
- resolveChildren(): void;
95
- readonly path: string[];
96
- }
97
- export declare namespace TestItem {
98
- function is(obj: unknown): obj is TestItem;
99
- }
100
- export interface TestController {
101
- readonly id: string;
102
- readonly label: string;
103
- readonly tests: readonly TestItem[];
104
- readonly testRunProfiles: readonly TestRunProfile[];
105
- readonly testRuns: readonly TestRun[];
106
- readonly onItemsChanged: Event<TreeDelta<string, TestItem>[]>;
107
- readonly onRunsChanged: Event<CollectionDelta<TestRun, TestRun>>;
108
- readonly onProfilesChanged: Event<CollectionDelta<TestRunProfile, TestRunProfile>>;
109
- refreshTests(token: CancellationToken): Promise<void>;
110
- clearRuns(): void;
111
- }
112
- export interface TestService {
113
- clearResults(): void;
114
- configureProfile(): void;
115
- runTestsWithProfile(tests: TestItem[]): void;
116
- runTests(profileKind: TestRunProfileKind, tests: TestItem[]): void;
117
- runAllTests(profileKind: TestRunProfileKind): void;
118
- getControllers(): TestController[];
119
- registerTestController(controller: TestController): Disposable;
120
- onControllersChanged: Event<CollectionDelta<string, TestController>>;
121
- refresh(): void;
122
- cancelRefresh(): void;
123
- isRefreshing: boolean;
124
- onDidChangeIsRefreshing: Event<void>;
125
- }
126
- export declare const TestContribution: unique symbol;
127
- export interface TestContribution {
128
- registerTestControllers(service: TestService): void;
129
- }
130
- export declare const TestService: unique symbol;
131
- export declare class DefaultTestService implements TestService {
132
- quickpickService: QuickPickService;
133
- private testRunCounter;
134
- private onDidChangeIsRefreshingEmitter;
135
- onDidChangeIsRefreshing: Event<void>;
136
- private controllers;
137
- private refreshing;
138
- private onControllersChangedEmitter;
139
- protected readonly contributionProvider: ContributionProvider<TestContribution>;
140
- protected registerContributions(): void;
141
- onControllersChanged: Event<CollectionDelta<string, TestController>>;
142
- registerTestController(controller: TestController): Disposable;
143
- getControllers(): TestController[];
144
- refresh(): void;
145
- cancelRefresh(): void;
146
- get isRefreshing(): boolean;
147
- runAllTests(profileKind: TestRunProfileKind): void;
148
- protected runTestForController(controller: TestController, profileKind: TestRunProfileKind, items: readonly TestItem[]): Promise<void>;
149
- protected pickProfile(runProfiles: readonly TestRunProfile[], title: string): Promise<TestRunProfile | undefined>;
150
- runTests(profileKind: TestRunProfileKind, items: TestItem[]): void;
151
- runTestsWithProfile(items: TestItem[]): void;
152
- configureProfile(): void;
153
- clearResults(): void;
154
- }
1
+ import { CancellationToken, ContributionProvider, Disposable, Event, QuickPickService } from '@theia/core/lib/common';
2
+ import { Location, Range } from '@theia/core/shared/vscode-languageserver-protocol';
3
+ import { CollectionDelta, TreeDelta } from '../common/tree-delta';
4
+ import { MarkdownString } from '@theia/core/lib/common/markdown-rendering';
5
+ import URI from '@theia/core/lib/common/uri';
6
+ export declare enum TestRunProfileKind {
7
+ Run = 1,
8
+ Debug = 2,
9
+ Coverage = 3
10
+ }
11
+ export interface TestRunProfile {
12
+ readonly kind: TestRunProfileKind;
13
+ readonly label: string;
14
+ readonly isDefault: boolean;
15
+ readonly canConfigure: boolean;
16
+ readonly tag: string;
17
+ run(name: string, included: readonly TestItem[], excluded: readonly TestItem[]): void;
18
+ configure(): void;
19
+ }
20
+ export interface TestOutputItem {
21
+ readonly output: string;
22
+ readonly location?: Location;
23
+ }
24
+ export declare enum TestExecutionState {
25
+ Queued = 1,
26
+ Running = 2,
27
+ Passed = 3,
28
+ Failed = 4,
29
+ Skipped = 5,
30
+ Errored = 6
31
+ }
32
+ export interface TestMessage {
33
+ readonly expected?: string;
34
+ readonly actual?: string;
35
+ readonly location: Location;
36
+ readonly message: string | MarkdownString;
37
+ readonly contextValue?: string;
38
+ }
39
+ export declare namespace TestMessage {
40
+ function is(obj: unknown): obj is TestMessage;
41
+ }
42
+ export interface TestState {
43
+ readonly state: TestExecutionState;
44
+ }
45
+ export interface TestFailure extends TestState {
46
+ readonly state: TestExecutionState.Failed | TestExecutionState.Errored;
47
+ readonly messages: TestMessage[];
48
+ readonly duration?: number;
49
+ }
50
+ export declare namespace TestFailure {
51
+ function is(obj: unknown): obj is TestFailure;
52
+ }
53
+ export interface TestSuccess extends TestState {
54
+ readonly state: TestExecutionState.Passed;
55
+ readonly duration?: number;
56
+ }
57
+ export interface TestStateChangedEvent {
58
+ test: TestItem;
59
+ oldState: TestState | undefined;
60
+ newState: TestState | undefined;
61
+ }
62
+ export interface TestRun {
63
+ cancel(): void;
64
+ readonly name: string;
65
+ readonly isRunning: boolean;
66
+ readonly controller: TestController;
67
+ onDidChangeProperty: Event<{
68
+ name?: string;
69
+ isRunning?: boolean;
70
+ }>;
71
+ getTestState(item: TestItem): TestState | undefined;
72
+ onDidChangeTestState: Event<TestStateChangedEvent[]>;
73
+ getOutput(item?: TestItem): readonly TestOutputItem[];
74
+ onDidChangeTestOutput: Event<[TestItem | undefined, TestOutputItem][]>;
75
+ readonly items: readonly TestItem[];
76
+ }
77
+ export declare namespace TestRun {
78
+ function is(obj: unknown): obj is TestRun;
79
+ }
80
+ export interface TestItem {
81
+ readonly id: string;
82
+ readonly label: string;
83
+ readonly range?: Range;
84
+ readonly sortKey?: string;
85
+ readonly tags: string[];
86
+ readonly uri?: URI;
87
+ readonly busy: boolean;
88
+ readonly tests: readonly TestItem[];
89
+ readonly description?: string;
90
+ readonly error?: string | MarkdownString;
91
+ readonly parent: TestItem | undefined;
92
+ readonly controller: TestController | undefined;
93
+ readonly canResolveChildren: boolean;
94
+ resolveChildren(): void;
95
+ readonly path: string[];
96
+ }
97
+ export declare namespace TestItem {
98
+ function is(obj: unknown): obj is TestItem;
99
+ }
100
+ export interface TestController {
101
+ readonly id: string;
102
+ readonly label: string;
103
+ readonly tests: readonly TestItem[];
104
+ readonly testRunProfiles: readonly TestRunProfile[];
105
+ readonly testRuns: readonly TestRun[];
106
+ readonly onItemsChanged: Event<TreeDelta<string, TestItem>[]>;
107
+ readonly onRunsChanged: Event<CollectionDelta<TestRun, TestRun>>;
108
+ readonly onProfilesChanged: Event<CollectionDelta<TestRunProfile, TestRunProfile>>;
109
+ refreshTests(token: CancellationToken): Promise<void>;
110
+ clearRuns(): void;
111
+ }
112
+ export interface TestService {
113
+ clearResults(): void;
114
+ configureProfile(): void;
115
+ runTestsWithProfile(tests: TestItem[]): void;
116
+ runTests(profileKind: TestRunProfileKind, tests: TestItem[]): void;
117
+ runAllTests(profileKind: TestRunProfileKind): void;
118
+ getControllers(): TestController[];
119
+ registerTestController(controller: TestController): Disposable;
120
+ onControllersChanged: Event<CollectionDelta<string, TestController>>;
121
+ refresh(): void;
122
+ cancelRefresh(): void;
123
+ isRefreshing: boolean;
124
+ onDidChangeIsRefreshing: Event<void>;
125
+ }
126
+ export declare const TestContribution: unique symbol;
127
+ export interface TestContribution {
128
+ registerTestControllers(service: TestService): void;
129
+ }
130
+ export declare const TestService: unique symbol;
131
+ export declare class DefaultTestService implements TestService {
132
+ quickpickService: QuickPickService;
133
+ private testRunCounter;
134
+ private onDidChangeIsRefreshingEmitter;
135
+ onDidChangeIsRefreshing: Event<void>;
136
+ private controllers;
137
+ private refreshing;
138
+ private onControllersChangedEmitter;
139
+ protected readonly contributionProvider: ContributionProvider<TestContribution>;
140
+ protected registerContributions(): void;
141
+ onControllersChanged: Event<CollectionDelta<string, TestController>>;
142
+ registerTestController(controller: TestController): Disposable;
143
+ getControllers(): TestController[];
144
+ refresh(): void;
145
+ cancelRefresh(): void;
146
+ get isRefreshing(): boolean;
147
+ runAllTests(profileKind: TestRunProfileKind): void;
148
+ protected runTestForController(controller: TestController, profileKind: TestRunProfileKind, items: readonly TestItem[]): Promise<void>;
149
+ protected pickProfile(runProfiles: readonly TestRunProfile[], title: string): Promise<TestRunProfile | undefined>;
150
+ runTests(profileKind: TestRunProfileKind, items: TestItem[]): void;
151
+ runTestsWithProfile(items: TestItem[]): void;
152
+ configureProfile(): void;
153
+ clearResults(): void;
154
+ }
155
155
  //# sourceMappingURL=test-service.d.ts.map