@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,134 +1,134 @@
1
- // *****************************************************************************
2
- // Copyright (C) 2023 STMicroelectronics and others.
3
- //
4
- // This program and the accompanying materials are made available under the
5
- // terms of the Eclipse Public License v. 2.0 which is available at
6
- // http://www.eclipse.org/legal/epl-2.0.
7
- //
8
- // This Source Code may also be made available under the following Secondary
9
- // Licenses when the conditions for such availability set forth in the Eclipse
10
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
- // with the GNU Classpath Exception which is available at
12
- // https://www.gnu.org/software/classpath/license.html.
13
- //
14
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
- // *****************************************************************************
16
-
17
- import '../../../src/browser/style/index.css';
18
-
19
- import { interfaces, ContainerModule, Container } from '@theia/core/shared/inversify';
20
- import {
21
- bindViewContribution, FrontendApplicationContribution,
22
- WidgetFactory, ViewContainer,
23
- WidgetManager, createTreeContainer
24
- } from '@theia/core/lib/browser';
25
- import { TestTree, TestTreeWidget } from './test-tree-widget';
26
- import { TestViewContribution, TEST_VIEW_CONTAINER_ID, TEST_VIEW_CONTAINER_TITLE_OPTIONS, TEST_VIEW_CONTEXT_MENU } from './test-view-contribution';
27
- import { TestService, TestContribution, DefaultTestService } from '../test-service';
28
- import { bindContributionProvider } from '@theia/core';
29
- import { TabBarToolbarContribution } from '@theia/core/lib/browser/shell/tab-bar-toolbar';
30
- import { TestExecutionStateManager } from './test-execution-state-manager';
31
- import { TestResultWidget } from './test-result-widget';
32
- import { TestOutputWidget } from './test-output-widget';
33
- import { TestOutputViewContribution } from './test-output-view-contribution';
34
- import { TestOutputUIModel } from './test-output-ui-model';
35
- import { TestRunTree, TestRunTreeWidget } from './test-run-widget';
36
- import { TestResultViewContribution } from './test-result-view-contribution';
37
- import { TEST_RUNS_CONTEXT_MENU, TestRunViewContribution } from './test-run-view-contribution';
38
- import { TestContextKeyService } from './test-context-key-service';
39
-
40
- export default new ContainerModule(bind => {
41
-
42
- bindContributionProvider(bind, TestContribution);
43
- bind(TestContextKeyService).toSelf().inSingletonScope();
44
- bind(TestService).to(DefaultTestService).inSingletonScope();
45
-
46
- bind(WidgetFactory).toDynamicValue(({ container }) => ({
47
- id: TestOutputWidget.ID,
48
- createWidget: () => container.get<TestOutputWidget>(TestOutputWidget)
49
- })).inSingletonScope();
50
-
51
- bind(TestOutputWidget).toSelf();
52
-
53
- bind(WidgetFactory).toDynamicValue(({ container }) => ({
54
- id: TestResultWidget.ID,
55
- createWidget: () => container.get<TestResultWidget>(TestResultWidget)
56
- })).inSingletonScope();
57
-
58
- bind(TestResultWidget).toSelf();
59
-
60
- bind(TestTreeWidget).toDynamicValue(({ container }) => {
61
- const child = createTestTreeContainer(container);
62
- return child.get(TestTreeWidget);
63
- });
64
- bind(WidgetFactory).toDynamicValue(({ container }) => ({
65
- id: TestTreeWidget.ID,
66
- createWidget: () => container.get<TestTreeWidget>(TestTreeWidget)
67
- })).inSingletonScope();
68
-
69
- bind(TestRunTreeWidget).toDynamicValue(({ container }) => {
70
- const child = createTestRunContainer(container);
71
- return child.get(TestRunTreeWidget);
72
- });
73
- bind(WidgetFactory).toDynamicValue(({ container }) => ({
74
- id: TestRunTreeWidget.ID,
75
- createWidget: () => container.get<TestRunTreeWidget>(TestRunTreeWidget)
76
- })).inSingletonScope();
77
-
78
- bind(WidgetFactory).toDynamicValue(({ container }) => ({
79
- id: TEST_VIEW_CONTAINER_ID,
80
- createWidget: async () => {
81
- const viewContainer = container.get<ViewContainer.Factory>(ViewContainer.Factory)({
82
- id: TEST_VIEW_CONTAINER_ID,
83
- progressLocationId: 'test'
84
- });
85
- viewContainer.setTitleOptions(TEST_VIEW_CONTAINER_TITLE_OPTIONS);
86
- let widget = await container.get(WidgetManager).getOrCreateWidget(TestTreeWidget.ID);
87
- viewContainer.addWidget(widget, {
88
- canHide: false,
89
- initiallyCollapsed: false
90
- });
91
- widget = await container.get(WidgetManager).getOrCreateWidget(TestRunTreeWidget.ID);
92
- viewContainer.addWidget(widget, {
93
- canHide: true,
94
- initiallyCollapsed: false,
95
- }); return viewContainer;
96
- }
97
- })).inSingletonScope();
98
-
99
- bindViewContribution(bind, TestViewContribution);
100
- bindViewContribution(bind, TestRunViewContribution);
101
- bindViewContribution(bind, TestResultViewContribution);
102
- bindViewContribution(bind, TestOutputViewContribution);
103
- bind(FrontendApplicationContribution).toService(TestViewContribution);
104
- bind(TabBarToolbarContribution).toService(TestViewContribution);
105
- bind(TabBarToolbarContribution).toService(TestRunViewContribution);
106
- bind(TestExecutionStateManager).toSelf().inSingletonScope();
107
- bind(TestOutputUIModel).toSelf().inSingletonScope();
108
-
109
- });
110
-
111
- export function createTestTreeContainer(parent: interfaces.Container): Container {
112
- return createTreeContainer(parent, {
113
- tree: TestTree,
114
- props: {
115
- virtualized: false,
116
- search: true,
117
- contextMenuPath: TEST_VIEW_CONTEXT_MENU
118
- },
119
- widget: TestTreeWidget,
120
- });
121
- }
122
-
123
- export function createTestRunContainer(parent: interfaces.Container): Container {
124
- return createTreeContainer(parent, {
125
- tree: TestRunTree,
126
- props: {
127
- virtualized: false,
128
- search: true,
129
- multiSelect: false,
130
- contextMenuPath: TEST_RUNS_CONTEXT_MENU
131
- },
132
- widget: TestRunTreeWidget
133
- });
134
- }
1
+ // *****************************************************************************
2
+ // Copyright (C) 2023 STMicroelectronics and others.
3
+ //
4
+ // This program and the accompanying materials are made available under the
5
+ // terms of the Eclipse Public License v. 2.0 which is available at
6
+ // http://www.eclipse.org/legal/epl-2.0.
7
+ //
8
+ // This Source Code may also be made available under the following Secondary
9
+ // Licenses when the conditions for such availability set forth in the Eclipse
10
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ // with the GNU Classpath Exception which is available at
12
+ // https://www.gnu.org/software/classpath/license.html.
13
+ //
14
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
+ // *****************************************************************************
16
+
17
+ import '../../../src/browser/style/index.css';
18
+
19
+ import { interfaces, ContainerModule, Container } from '@theia/core/shared/inversify';
20
+ import {
21
+ bindViewContribution, FrontendApplicationContribution,
22
+ WidgetFactory, ViewContainer,
23
+ WidgetManager, createTreeContainer
24
+ } from '@theia/core/lib/browser';
25
+ import { TestTree, TestTreeWidget } from './test-tree-widget';
26
+ import { TestViewContribution, TEST_VIEW_CONTAINER_ID, TEST_VIEW_CONTAINER_TITLE_OPTIONS, TEST_VIEW_CONTEXT_MENU } from './test-view-contribution';
27
+ import { TestService, TestContribution, DefaultTestService } from '../test-service';
28
+ import { bindContributionProvider } from '@theia/core';
29
+ import { TabBarToolbarContribution } from '@theia/core/lib/browser/shell/tab-bar-toolbar';
30
+ import { TestExecutionStateManager } from './test-execution-state-manager';
31
+ import { TestResultWidget } from './test-result-widget';
32
+ import { TestOutputWidget } from './test-output-widget';
33
+ import { TestOutputViewContribution } from './test-output-view-contribution';
34
+ import { TestOutputUIModel } from './test-output-ui-model';
35
+ import { TestRunTree, TestRunTreeWidget } from './test-run-widget';
36
+ import { TestResultViewContribution } from './test-result-view-contribution';
37
+ import { TEST_RUNS_CONTEXT_MENU, TestRunViewContribution } from './test-run-view-contribution';
38
+ import { TestContextKeyService } from './test-context-key-service';
39
+
40
+ export default new ContainerModule(bind => {
41
+
42
+ bindContributionProvider(bind, TestContribution);
43
+ bind(TestContextKeyService).toSelf().inSingletonScope();
44
+ bind(TestService).to(DefaultTestService).inSingletonScope();
45
+
46
+ bind(WidgetFactory).toDynamicValue(({ container }) => ({
47
+ id: TestOutputWidget.ID,
48
+ createWidget: () => container.get<TestOutputWidget>(TestOutputWidget)
49
+ })).inSingletonScope();
50
+
51
+ bind(TestOutputWidget).toSelf();
52
+
53
+ bind(WidgetFactory).toDynamicValue(({ container }) => ({
54
+ id: TestResultWidget.ID,
55
+ createWidget: () => container.get<TestResultWidget>(TestResultWidget)
56
+ })).inSingletonScope();
57
+
58
+ bind(TestResultWidget).toSelf();
59
+
60
+ bind(TestTreeWidget).toDynamicValue(({ container }) => {
61
+ const child = createTestTreeContainer(container);
62
+ return child.get(TestTreeWidget);
63
+ });
64
+ bind(WidgetFactory).toDynamicValue(({ container }) => ({
65
+ id: TestTreeWidget.ID,
66
+ createWidget: () => container.get<TestTreeWidget>(TestTreeWidget)
67
+ })).inSingletonScope();
68
+
69
+ bind(TestRunTreeWidget).toDynamicValue(({ container }) => {
70
+ const child = createTestRunContainer(container);
71
+ return child.get(TestRunTreeWidget);
72
+ });
73
+ bind(WidgetFactory).toDynamicValue(({ container }) => ({
74
+ id: TestRunTreeWidget.ID,
75
+ createWidget: () => container.get<TestRunTreeWidget>(TestRunTreeWidget)
76
+ })).inSingletonScope();
77
+
78
+ bind(WidgetFactory).toDynamicValue(({ container }) => ({
79
+ id: TEST_VIEW_CONTAINER_ID,
80
+ createWidget: async () => {
81
+ const viewContainer = container.get<ViewContainer.Factory>(ViewContainer.Factory)({
82
+ id: TEST_VIEW_CONTAINER_ID,
83
+ progressLocationId: 'test'
84
+ });
85
+ viewContainer.setTitleOptions(TEST_VIEW_CONTAINER_TITLE_OPTIONS);
86
+ let widget = await container.get(WidgetManager).getOrCreateWidget(TestTreeWidget.ID);
87
+ viewContainer.addWidget(widget, {
88
+ canHide: false,
89
+ initiallyCollapsed: false
90
+ });
91
+ widget = await container.get(WidgetManager).getOrCreateWidget(TestRunTreeWidget.ID);
92
+ viewContainer.addWidget(widget, {
93
+ canHide: true,
94
+ initiallyCollapsed: false,
95
+ }); return viewContainer;
96
+ }
97
+ })).inSingletonScope();
98
+
99
+ bindViewContribution(bind, TestViewContribution);
100
+ bindViewContribution(bind, TestRunViewContribution);
101
+ bindViewContribution(bind, TestResultViewContribution);
102
+ bindViewContribution(bind, TestOutputViewContribution);
103
+ bind(FrontendApplicationContribution).toService(TestViewContribution);
104
+ bind(TabBarToolbarContribution).toService(TestViewContribution);
105
+ bind(TabBarToolbarContribution).toService(TestRunViewContribution);
106
+ bind(TestExecutionStateManager).toSelf().inSingletonScope();
107
+ bind(TestOutputUIModel).toSelf().inSingletonScope();
108
+
109
+ });
110
+
111
+ export function createTestTreeContainer(parent: interfaces.Container): Container {
112
+ return createTreeContainer(parent, {
113
+ tree: TestTree,
114
+ props: {
115
+ virtualized: false,
116
+ search: true,
117
+ contextMenuPath: TEST_VIEW_CONTEXT_MENU
118
+ },
119
+ widget: TestTreeWidget,
120
+ });
121
+ }
122
+
123
+ export function createTestRunContainer(parent: interfaces.Container): Container {
124
+ return createTreeContainer(parent, {
125
+ tree: TestRunTree,
126
+ props: {
127
+ virtualized: false,
128
+ search: true,
129
+ multiSelect: false,
130
+ contextMenuPath: TEST_RUNS_CONTEXT_MENU
131
+ },
132
+ widget: TestRunTreeWidget
133
+ });
134
+ }