UNPKG

wdio-ms-teams-service

Version:

A WebdriverIO plugin to report to Microsoft Teams channel webhooks

25 lines (24 loc) 818 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); class TestResultContainer { constructor() { this.testNames = []; this.testResults = {}; this.passedTests = 0; this.failedTests = 0; this.totalTests = 0; } addTest(testName, result) { if (this.testNames.indexOf(testName) === -1) { // Add to testNames array to preserve test order this.testNames.push(testName); } if (!Object.prototype.hasOwnProperty.call(this.testResults, testName)) { this.testResults[testName] = []; } this.testResults[testName].push(result); result.passed ? (this.passedTests += 1) : (this.failedTests += 1); this.totalTests += 1; } } exports.default = TestResultContainer;