testit-js-commons 2.1.7 → 2.1.8
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.
|
@@ -13,6 +13,6 @@ export declare class AutotestsService extends BaseService implements IAutotestSe
|
|
|
13
13
|
private loadPassedAutotest;
|
|
14
14
|
private loadFailedAutotest;
|
|
15
15
|
loadAutotest(autotest: AutotestPost, isPassed: boolean): Promise<void>;
|
|
16
|
-
linkToWorkItems(externalId: string,
|
|
16
|
+
linkToWorkItems(externalId: string, workItemIds: Array<string>): Promise<void>;
|
|
17
17
|
getAutotestByExternalId(externalId: string): Promise<AutotestGet | null>;
|
|
18
18
|
}
|
|
@@ -61,13 +61,13 @@ class AutotestsService extends base_service_1.BaseService {
|
|
|
61
61
|
isPassed ? yield this.loadPassedAutotest(autotest) : yield this.loadFailedAutotest(autotest);
|
|
62
62
|
});
|
|
63
63
|
}
|
|
64
|
-
linkToWorkItems(externalId,
|
|
64
|
+
linkToWorkItems(externalId, workItemIds) {
|
|
65
65
|
return __awaiter(this, void 0, void 0, function* () {
|
|
66
66
|
const internalId = yield this.getAutotestByExternalId(externalId).then((test) => test === null || test === void 0 ? void 0 : test.id);
|
|
67
67
|
if (internalId === undefined) {
|
|
68
68
|
throw new Error(`Autotest with external id ${externalId} not found`);
|
|
69
69
|
}
|
|
70
|
-
const promises =
|
|
70
|
+
const promises = workItemIds.map((workItemId) => this._client.linkAutoTestToWorkItem(internalId, { id: workItemId }));
|
|
71
71
|
yield Promise.all(promises).catch((err) => (0, autotests_handler_1.handleHttpError)(err, "Failed link work item"));
|
|
72
72
|
});
|
|
73
73
|
}
|