@theia/test 1.53.0-next.5 → 1.53.0-next.55
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.
- package/lib/browser/view/test-view-contribution.d.ts +1 -0
- package/lib/browser/view/test-view-contribution.d.ts.map +1 -1
- package/lib/browser/view/test-view-contribution.js +10 -1
- package/lib/browser/view/test-view-contribution.js.map +1 -1
- package/package.json +8 -8
- package/src/browser/constants.ts +71 -71
- package/src/browser/style/index.css +41 -41
- package/src/browser/test-execution-progress-service.ts +53 -53
- package/src/browser/test-preferences.ts +58 -58
- package/src/browser/test-service.ts +402 -402
- package/src/browser/view/test-context-key-service.ts +36 -36
- package/src/browser/view/test-execution-state-manager.ts +147 -147
- package/src/browser/view/test-output-ui-model.ts +156 -156
- package/src/browser/view/test-output-view-contribution.ts +34 -34
- package/src/browser/view/test-output-widget.ts +148 -148
- package/src/browser/view/test-result-view-contribution.ts +34 -34
- package/src/browser/view/test-result-widget.ts +92 -92
- package/src/browser/view/test-run-view-contribution.ts +89 -89
- package/src/browser/view/test-run-widget.tsx +271 -271
- package/src/browser/view/test-tree-widget.tsx +360 -360
- package/src/browser/view/test-view-contribution.ts +328 -319
- package/src/browser/view/test-view-frontend-module.ts +136 -136
- package/src/common/collections.ts +223 -223
- package/src/common/tree-delta.spec.ts +166 -166
- package/src/common/tree-delta.ts +259 -259
|
@@ -1,166 +1,166 @@
|
|
|
1
|
-
// *****************************************************************************
|
|
2
|
-
// Copyright (C) 2022 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
|
-
import { DeltaKind, TreeDelta, TreeDeltaBuilderImpl } from './tree-delta';
|
|
17
|
-
import * as chai from 'chai';
|
|
18
|
-
|
|
19
|
-
const expect = chai.expect;
|
|
20
|
-
|
|
21
|
-
interface TestType {
|
|
22
|
-
id: string;
|
|
23
|
-
prop: number;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
describe('TreeDeltaBuilder tests', () => {
|
|
27
|
-
|
|
28
|
-
it('should split paths', () => {
|
|
29
|
-
const builder = new TreeDeltaBuilderImpl<string, TestType>();
|
|
30
|
-
|
|
31
|
-
builder.reportAdded(['a', 'b', 'c'], {
|
|
32
|
-
id: 'c',
|
|
33
|
-
prop: 17
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
builder.reportRemoved(['a', 'b', 'd', 'e']);
|
|
37
|
-
|
|
38
|
-
const expected: TreeDelta<string, TestType> = {
|
|
39
|
-
path: ['a', 'b'],
|
|
40
|
-
type: DeltaKind.NONE,
|
|
41
|
-
childDeltas: [
|
|
42
|
-
{
|
|
43
|
-
path: ['d', 'e'],
|
|
44
|
-
type: DeltaKind.REMOVED,
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
type: DeltaKind.ADDED,
|
|
48
|
-
path: ['c'],
|
|
49
|
-
value: { id: 'c', prop: 17 },
|
|
50
|
-
},
|
|
51
|
-
]
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
expect(builder.currentDelta).deep.equal([
|
|
55
|
-
expected
|
|
56
|
-
]);
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
it('should merge add/remove child', () => {
|
|
60
|
-
const builder = new TreeDeltaBuilderImpl<string, TestType>();
|
|
61
|
-
|
|
62
|
-
builder.reportAdded(['a', 'b', 'c'], {
|
|
63
|
-
id: 'c',
|
|
64
|
-
prop: 17
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
builder.reportRemoved(['a', 'b', 'c', 'd']);
|
|
68
|
-
|
|
69
|
-
expect(builder.currentDelta).deep.equal([{
|
|
70
|
-
path: ['a', 'b', 'c'],
|
|
71
|
-
type: DeltaKind.ADDED,
|
|
72
|
-
value: { id: 'c', prop: 17 },
|
|
73
|
-
}]);
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
it('should merge change', () => {
|
|
77
|
-
const builder = new TreeDeltaBuilderImpl<string, TestType>();
|
|
78
|
-
|
|
79
|
-
builder.reportChanged(['a', 'b', 'c'], { id: 'c', prop: 17 });
|
|
80
|
-
builder.reportChanged(['a', 'b', 'c'], { prop: 18 });
|
|
81
|
-
builder.reportChanged(['a', 'b', 'c'], { prop: 19 });
|
|
82
|
-
|
|
83
|
-
expect(builder.currentDelta).deep.equal([
|
|
84
|
-
{
|
|
85
|
-
type: DeltaKind.CHANGED,
|
|
86
|
-
path: ['a', 'b', 'c'],
|
|
87
|
-
value: { id: 'c', prop: 19 },
|
|
88
|
-
}
|
|
89
|
-
]);
|
|
90
|
-
});
|
|
91
|
-
|
|
92
|
-
it('should merge add/change', () => {
|
|
93
|
-
const builder = new TreeDeltaBuilderImpl<string, TestType>();
|
|
94
|
-
|
|
95
|
-
const obj = {
|
|
96
|
-
id: 'c',
|
|
97
|
-
prop: 17
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
builder.reportAdded(['a', 'b', 'c'], obj);
|
|
101
|
-
|
|
102
|
-
obj.prop = 18;
|
|
103
|
-
|
|
104
|
-
builder.reportChanged(['a', 'b', 'c'], { prop: 18 });
|
|
105
|
-
|
|
106
|
-
expect(builder.currentDelta).deep.equal([
|
|
107
|
-
{
|
|
108
|
-
type: DeltaKind.ADDED,
|
|
109
|
-
path: ['a', 'b', 'c'],
|
|
110
|
-
value: { id: 'c', prop: 18 },
|
|
111
|
-
}
|
|
112
|
-
]);
|
|
113
|
-
});
|
|
114
|
-
|
|
115
|
-
it('should handle adds/delete', () => {
|
|
116
|
-
const builder = new TreeDeltaBuilderImpl<string, TestType>();
|
|
117
|
-
builder.reportAdded(['a', 'b'], { id: 'c', prop: 14 });
|
|
118
|
-
builder.reportRemoved(['a', 'b']);
|
|
119
|
-
expect(builder.currentDelta).deep.equal([]);
|
|
120
|
-
builder.reportAdded(['a', 'b'], { id: 'c', prop: 20 });
|
|
121
|
-
expect(builder.currentDelta).deep.equal([{
|
|
122
|
-
path: ['a', 'b'],
|
|
123
|
-
type: DeltaKind.ADDED,
|
|
124
|
-
value: { id: 'c', prop: 20 }
|
|
125
|
-
}]);
|
|
126
|
-
});
|
|
127
|
-
|
|
128
|
-
it('should handle delete/add', () => {
|
|
129
|
-
const builder = new TreeDeltaBuilderImpl<string, TestType>();
|
|
130
|
-
builder.reportRemoved(['a', 'b']);
|
|
131
|
-
builder.reportAdded(['a', 'b'], { id: 'c', prop: 14 });
|
|
132
|
-
expect(builder.currentDelta).deep.equal([{
|
|
133
|
-
path: ['a', 'b'],
|
|
134
|
-
type: DeltaKind.CHANGED,
|
|
135
|
-
value: { id: 'c', prop: 14 }
|
|
136
|
-
}]);
|
|
137
|
-
builder.reportRemoved(['a', 'b']);
|
|
138
|
-
expect(builder.currentDelta).deep.equal([{
|
|
139
|
-
path: ['a', 'b'],
|
|
140
|
-
type: DeltaKind.REMOVED,
|
|
141
|
-
}]);
|
|
142
|
-
});
|
|
143
|
-
|
|
144
|
-
it('should handle changed below changed', () => {
|
|
145
|
-
const builder = new TreeDeltaBuilderImpl<string, TestType>();
|
|
146
|
-
builder.reportChanged(['a', 'b', 'c', 'e'], { id: 'e', prop: 14 });
|
|
147
|
-
builder.reportChanged(['a', 'b', 'c', 'd'], { id: 'd', prop: 23 });
|
|
148
|
-
builder.reportChanged(['a', 'b', 'c'], { id: 'c', prop: 27 });
|
|
149
|
-
expect(builder.currentDelta).deep.equal([{
|
|
150
|
-
path: ['a', 'b', 'c'],
|
|
151
|
-
type: DeltaKind.CHANGED,
|
|
152
|
-
value: { id: 'c', prop: 27 },
|
|
153
|
-
childDeltas: [
|
|
154
|
-
{
|
|
155
|
-
path: ['d'],
|
|
156
|
-
type: DeltaKind.CHANGED,
|
|
157
|
-
value: { id: 'd', prop: 23 }
|
|
158
|
-
}, {
|
|
159
|
-
path: ['e'],
|
|
160
|
-
type: DeltaKind.CHANGED,
|
|
161
|
-
value: { id: 'e', prop: 14 }
|
|
162
|
-
}]
|
|
163
|
-
}]);
|
|
164
|
-
});
|
|
165
|
-
|
|
166
|
-
});
|
|
1
|
+
// *****************************************************************************
|
|
2
|
+
// Copyright (C) 2022 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
|
+
import { DeltaKind, TreeDelta, TreeDeltaBuilderImpl } from './tree-delta';
|
|
17
|
+
import * as chai from 'chai';
|
|
18
|
+
|
|
19
|
+
const expect = chai.expect;
|
|
20
|
+
|
|
21
|
+
interface TestType {
|
|
22
|
+
id: string;
|
|
23
|
+
prop: number;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
describe('TreeDeltaBuilder tests', () => {
|
|
27
|
+
|
|
28
|
+
it('should split paths', () => {
|
|
29
|
+
const builder = new TreeDeltaBuilderImpl<string, TestType>();
|
|
30
|
+
|
|
31
|
+
builder.reportAdded(['a', 'b', 'c'], {
|
|
32
|
+
id: 'c',
|
|
33
|
+
prop: 17
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
builder.reportRemoved(['a', 'b', 'd', 'e']);
|
|
37
|
+
|
|
38
|
+
const expected: TreeDelta<string, TestType> = {
|
|
39
|
+
path: ['a', 'b'],
|
|
40
|
+
type: DeltaKind.NONE,
|
|
41
|
+
childDeltas: [
|
|
42
|
+
{
|
|
43
|
+
path: ['d', 'e'],
|
|
44
|
+
type: DeltaKind.REMOVED,
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
type: DeltaKind.ADDED,
|
|
48
|
+
path: ['c'],
|
|
49
|
+
value: { id: 'c', prop: 17 },
|
|
50
|
+
},
|
|
51
|
+
]
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
expect(builder.currentDelta).deep.equal([
|
|
55
|
+
expected
|
|
56
|
+
]);
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
it('should merge add/remove child', () => {
|
|
60
|
+
const builder = new TreeDeltaBuilderImpl<string, TestType>();
|
|
61
|
+
|
|
62
|
+
builder.reportAdded(['a', 'b', 'c'], {
|
|
63
|
+
id: 'c',
|
|
64
|
+
prop: 17
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
builder.reportRemoved(['a', 'b', 'c', 'd']);
|
|
68
|
+
|
|
69
|
+
expect(builder.currentDelta).deep.equal([{
|
|
70
|
+
path: ['a', 'b', 'c'],
|
|
71
|
+
type: DeltaKind.ADDED,
|
|
72
|
+
value: { id: 'c', prop: 17 },
|
|
73
|
+
}]);
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
it('should merge change', () => {
|
|
77
|
+
const builder = new TreeDeltaBuilderImpl<string, TestType>();
|
|
78
|
+
|
|
79
|
+
builder.reportChanged(['a', 'b', 'c'], { id: 'c', prop: 17 });
|
|
80
|
+
builder.reportChanged(['a', 'b', 'c'], { prop: 18 });
|
|
81
|
+
builder.reportChanged(['a', 'b', 'c'], { prop: 19 });
|
|
82
|
+
|
|
83
|
+
expect(builder.currentDelta).deep.equal([
|
|
84
|
+
{
|
|
85
|
+
type: DeltaKind.CHANGED,
|
|
86
|
+
path: ['a', 'b', 'c'],
|
|
87
|
+
value: { id: 'c', prop: 19 },
|
|
88
|
+
}
|
|
89
|
+
]);
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
it('should merge add/change', () => {
|
|
93
|
+
const builder = new TreeDeltaBuilderImpl<string, TestType>();
|
|
94
|
+
|
|
95
|
+
const obj = {
|
|
96
|
+
id: 'c',
|
|
97
|
+
prop: 17
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
builder.reportAdded(['a', 'b', 'c'], obj);
|
|
101
|
+
|
|
102
|
+
obj.prop = 18;
|
|
103
|
+
|
|
104
|
+
builder.reportChanged(['a', 'b', 'c'], { prop: 18 });
|
|
105
|
+
|
|
106
|
+
expect(builder.currentDelta).deep.equal([
|
|
107
|
+
{
|
|
108
|
+
type: DeltaKind.ADDED,
|
|
109
|
+
path: ['a', 'b', 'c'],
|
|
110
|
+
value: { id: 'c', prop: 18 },
|
|
111
|
+
}
|
|
112
|
+
]);
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
it('should handle adds/delete', () => {
|
|
116
|
+
const builder = new TreeDeltaBuilderImpl<string, TestType>();
|
|
117
|
+
builder.reportAdded(['a', 'b'], { id: 'c', prop: 14 });
|
|
118
|
+
builder.reportRemoved(['a', 'b']);
|
|
119
|
+
expect(builder.currentDelta).deep.equal([]);
|
|
120
|
+
builder.reportAdded(['a', 'b'], { id: 'c', prop: 20 });
|
|
121
|
+
expect(builder.currentDelta).deep.equal([{
|
|
122
|
+
path: ['a', 'b'],
|
|
123
|
+
type: DeltaKind.ADDED,
|
|
124
|
+
value: { id: 'c', prop: 20 }
|
|
125
|
+
}]);
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
it('should handle delete/add', () => {
|
|
129
|
+
const builder = new TreeDeltaBuilderImpl<string, TestType>();
|
|
130
|
+
builder.reportRemoved(['a', 'b']);
|
|
131
|
+
builder.reportAdded(['a', 'b'], { id: 'c', prop: 14 });
|
|
132
|
+
expect(builder.currentDelta).deep.equal([{
|
|
133
|
+
path: ['a', 'b'],
|
|
134
|
+
type: DeltaKind.CHANGED,
|
|
135
|
+
value: { id: 'c', prop: 14 }
|
|
136
|
+
}]);
|
|
137
|
+
builder.reportRemoved(['a', 'b']);
|
|
138
|
+
expect(builder.currentDelta).deep.equal([{
|
|
139
|
+
path: ['a', 'b'],
|
|
140
|
+
type: DeltaKind.REMOVED,
|
|
141
|
+
}]);
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
it('should handle changed below changed', () => {
|
|
145
|
+
const builder = new TreeDeltaBuilderImpl<string, TestType>();
|
|
146
|
+
builder.reportChanged(['a', 'b', 'c', 'e'], { id: 'e', prop: 14 });
|
|
147
|
+
builder.reportChanged(['a', 'b', 'c', 'd'], { id: 'd', prop: 23 });
|
|
148
|
+
builder.reportChanged(['a', 'b', 'c'], { id: 'c', prop: 27 });
|
|
149
|
+
expect(builder.currentDelta).deep.equal([{
|
|
150
|
+
path: ['a', 'b', 'c'],
|
|
151
|
+
type: DeltaKind.CHANGED,
|
|
152
|
+
value: { id: 'c', prop: 27 },
|
|
153
|
+
childDeltas: [
|
|
154
|
+
{
|
|
155
|
+
path: ['d'],
|
|
156
|
+
type: DeltaKind.CHANGED,
|
|
157
|
+
value: { id: 'd', prop: 23 }
|
|
158
|
+
}, {
|
|
159
|
+
path: ['e'],
|
|
160
|
+
type: DeltaKind.CHANGED,
|
|
161
|
+
value: { id: 'e', prop: 14 }
|
|
162
|
+
}]
|
|
163
|
+
}]);
|
|
164
|
+
});
|
|
165
|
+
|
|
166
|
+
});
|