@sap_oss/wdio-qmate-service
Version:
[](https://api.reuse.software/info/github.com/SAP/wdio-qmate-service)[](http
33 lines • 1.42 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = default_1;
const dataExchangeCommands_1 = __importDefault(require("./utils/dataExchangeCommands"));
const stats_1 = require("../stats/stats");
/**
* Gets executed after all workers got shut down and the process is about to exit. An error
* thrown in the onComplete hook will result in the test run failing.
* @param {Object} exitCode 0 - success, 1 - fail
* @param {Object} config wdio configuration object
* @param {Array.<Object>} capabilities list of capabilities details
* @param {<Object>} results object containing test results
*/
async function default_1(exitCode, config, capabilities, results, statsUsageId) {
await dataExchangeCommands_1.default.writeExportData();
if (statsUsageId !== null) {
if (config.params && config.params.qmateStatsOptions) {
if (!config.params.qmateStatsOptions.optOut) {
if (exitCode === 0) {
(0, stats_1.updateUsageRequests)(statsUsageId, 'success');
}
else if (exitCode === 1) {
(0, stats_1.updateUsageRequests)(statsUsageId, 'fail');
}
}
}
}
}
;
//# sourceMappingURL=onComplete.js.map