@opentap/runner-client 2.19.0-alpha.1.8 → 2.19.0-alpha.1.9
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/SessionClient.d.ts +6 -1
- package/lib/SessionClient.js +21 -33
- package/package.json +1 -1
package/lib/SessionClient.d.ts
CHANGED
|
@@ -23,7 +23,12 @@ export declare class SessionClient extends BaseClient {
|
|
|
23
23
|
* @returns Subscription array: Result and Test Run subscriptions
|
|
24
24
|
*/
|
|
25
25
|
connectSessionResults(resultHandler: (result: Result | undefined, err: NatsError | Error | null) => void, testRunHandler: (testRun: TestRun | undefined, err: NatsError | Error | null) => void, options?: SubscriptionOptions): [Subscription, Subscription];
|
|
26
|
-
|
|
26
|
+
/**
|
|
27
|
+
* @param testRunHandler Function to be called when test run or error is received
|
|
28
|
+
* @param options (optional) Subscription options
|
|
29
|
+
* @returns Subscription array: Result and Test Run subscriptions
|
|
30
|
+
*/
|
|
31
|
+
connectTestRunEvents(testRunHandler: (testRun: TestRun | undefined, err: NatsError | Error | null) => void, options?: SubscriptionOptions): Subscription;
|
|
27
32
|
/**
|
|
28
33
|
* Connect to listen to the TestPlanRun events for the given test plan run ID.
|
|
29
34
|
* @param {string} testPlanRunId
|
package/lib/SessionClient.js
CHANGED
|
@@ -120,39 +120,27 @@ var SessionClient = /** @class */ (function (_super) {
|
|
|
120
120
|
} })),
|
|
121
121
|
];
|
|
122
122
|
};
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
}
|
|
145
|
-
try {
|
|
146
|
-
var jsonCodec = JSONCodec();
|
|
147
|
-
var testRunJs = jsonCodec.decode(encodedMessage === null || encodedMessage === void 0 ? void 0 : encodedMessage.data);
|
|
148
|
-
var testRun = TestRun.fromJS(testRunJs);
|
|
149
|
-
testRunHandler(testRun, error);
|
|
150
|
-
}
|
|
151
|
-
catch (error) {
|
|
152
|
-
testRunHandler(undefined, error);
|
|
153
|
-
}
|
|
154
|
-
} })),
|
|
155
|
-
];
|
|
123
|
+
/**
|
|
124
|
+
* @param testRunHandler Function to be called when test run or error is received
|
|
125
|
+
* @param options (optional) Subscription options
|
|
126
|
+
* @returns Subscription array: Result and Test Run subscriptions
|
|
127
|
+
*/
|
|
128
|
+
SessionClient.prototype.connectTestRunEvents = function (testRunHandler, options) {
|
|
129
|
+
return this.subscribe('OnTestRun', __assign(__assign({}, options), { callback: function (error, encodedMessage) {
|
|
130
|
+
if (error) {
|
|
131
|
+
testRunHandler(undefined, error);
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
try {
|
|
135
|
+
var jsonCodec = JSONCodec();
|
|
136
|
+
var testRunJs = jsonCodec.decode(encodedMessage === null || encodedMessage === void 0 ? void 0 : encodedMessage.data);
|
|
137
|
+
var testRun = TestRun.fromJS(testRunJs);
|
|
138
|
+
testRunHandler(testRun, error);
|
|
139
|
+
}
|
|
140
|
+
catch (error) {
|
|
141
|
+
testRunHandler(undefined, error);
|
|
142
|
+
}
|
|
143
|
+
} }));
|
|
156
144
|
};
|
|
157
145
|
/**
|
|
158
146
|
* Connect to listen to the TestPlanRun events for the given test plan run ID.
|