1 | "use strict";
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 | Object.defineProperty(exports, "__esModule", { value: true });
|
18 | const chai_1 = require("chai");
|
19 | const progress_location_service_1 = require("./progress-location-service");
|
20 | const common_1 = require("../common");
|
21 | describe('progress-location-service', () => {
|
22 | const EXP = 'exp';
|
23 | const SCM = 'scm';
|
24 | const FOO = 'foo';
|
25 | it('done event should be fired for multiple progress locations – bug #7311', async () => {
|
26 | const eventLog = new Array();
|
27 | const logEvent = (location, show) => eventLog.push(`${location} show: ${show}`);
|
28 | const service = new progress_location_service_1.ProgressLocationService();
|
29 | [EXP, SCM, FOO].map(location => {
|
30 | service.onProgress(location)(e => logEvent(location, e.show));
|
31 | const progressToken = new common_1.CancellationTokenSource();
|
32 | service.showProgress(`progress-${location}-${Date.now()}`, { text: '', options: { location } }, progressToken.token);
|
33 | return progressToken;
|
34 | }).forEach(t => t.cancel());
|
35 | (0, chai_1.expect)(eventLog.join('\n')).eq(`
|
36 | exp show: true
|
37 | scm show: true
|
38 | foo show: true
|
39 | exp show: false
|
40 | scm show: false
|
41 | foo show: false
|
42 | `.trim());
|
43 | });
|
44 | });
|
45 |
|
\ | No newline at end of file |