@wdio/junit-reporter 8.0.11 → 8.0.14

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/build/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
- import WDIOReporter, { RunnerStats, TestStats } from '@wdio/reporter';
1
+ import type { RunnerStats, TestStats } from '@wdio/reporter';
2
+ import WDIOReporter from '@wdio/reporter';
2
3
  import type { JUnitReporterOptions } from './types';
3
4
  /**
4
5
  * Reporter that converts test results from a single instance/runner into an XML JUnit report. This class
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,YAAY,EAAE,EAAc,WAAW,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAIjF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAOnD;;;;;GAKG;AACH,cAAM,aAAc,SAAQ,YAAY;IAQhB,OAAO,EAAE,oBAAoB;IAPjD,OAAO,CAAC,eAAe,CAAQ;IAC/B,OAAO,CAAC,YAAY,CAAC,CAAQ;IAC7B,OAAO,CAAC,gBAAgB,CAAC,CAAQ;IACjC,OAAO,CAAC,cAAc,CAAC,CAAQ;IAC/B,OAAO,CAAC,cAAc,CAAC,CAAK;IAC5B,OAAO,CAAC,kBAAkB,CAAC,CAAK;gBAEZ,OAAO,EAAE,oBAAoB;IAOjD,WAAW,CAAE,SAAS,EAAE,SAAS;IAIjC,WAAW,CAAE,MAAM,EAAE,WAAW;IAKhC,OAAO,CAAC,YAAY;IAMpB,OAAO,CAAC,eAAe;IAkBvB,OAAO,CAAC,4BAA4B;IA6EpC,OAAO,CAAC,kBAAkB;IA2E1B,OAAO,CAAC,cAAc;IAuCtB,OAAO,CAAC,mBAAmB;IAmB3B,OAAO,CAAC,kBAAkB;IAoB1B,OAAO,CAAC,OAAO;CAGlB;AAED,eAAe,aAAa,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAc,WAAW,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AACxE,OAAO,YAAY,MAAM,gBAAgB,CAAA;AAIzC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAOnD;;;;;GAKG;AACH,cAAM,aAAc,SAAQ,YAAY;IAQhB,OAAO,EAAE,oBAAoB;IAPjD,OAAO,CAAC,eAAe,CAAQ;IAC/B,OAAO,CAAC,YAAY,CAAC,CAAQ;IAC7B,OAAO,CAAC,gBAAgB,CAAC,CAAQ;IACjC,OAAO,CAAC,cAAc,CAAC,CAAQ;IAC/B,OAAO,CAAC,cAAc,CAAC,CAAK;IAC5B,OAAO,CAAC,kBAAkB,CAAC,CAAK;gBAEZ,OAAO,EAAE,oBAAoB;IAOjD,WAAW,CAAE,SAAS,EAAE,SAAS;IAIjC,WAAW,CAAE,MAAM,EAAE,WAAW;IAKhC,OAAO,CAAC,YAAY;IAMpB,OAAO,CAAC,eAAe;IAkBvB,OAAO,CAAC,4BAA4B;IA6EpC,OAAO,CAAC,kBAAkB;IA6E1B,OAAO,CAAC,cAAc;IAuCtB,OAAO,CAAC,mBAAmB;IAmB3B,OAAO,CAAC,kBAAkB;IAoB1B,OAAO,CAAC,OAAO;CAGlB;AAED,eAAe,aAAa,CAAA"}
package/build/index.js CHANGED
@@ -84,7 +84,7 @@ class JunitReporter extends WDIOReporter {
84
84
  scenario = this._addFailedHooks(scenario);
85
85
  let stepsOutput = '';
86
86
  let isFailing = false;
87
- for (let stepKey of Object.keys(scenario.tests)) { // tests are trested as steps in Cucumber
87
+ for (const stepKey of Object.keys(scenario.tests)) { // tests are trested as steps in Cucumber
88
88
  if (stepKey === 'undefined') { // fix cucumber hooks crashing reporter
89
89
  continue;
90
90
  }
@@ -131,7 +131,7 @@ class JunitReporter extends WDIOReporter {
131
131
  const suiteName = !this.options.suiteNameFormat || this.options.suiteNameFormat instanceof RegExp
132
132
  ? this._prepareName(suite.title)
133
133
  : this.options.suiteNameFormat({ name: this.options.suiteNameFormat.name, suite });
134
- let testSuite = builder.testSuite()
134
+ const testSuite = builder.testSuite()
135
135
  .name(suiteName)
136
136
  .timestamp(suite.start)
137
137
  .time(suite._duration / 1000)
@@ -140,7 +140,7 @@ class JunitReporter extends WDIOReporter {
140
140
  .property('capabilities', runner.sanitizedCapabilities)
141
141
  .property(this._fileNameLabel, filePath);
142
142
  suite = this._addFailedHooks(suite);
143
- for (let testKey of Object.keys(suite.tests)) {
143
+ for (const testKey of Object.keys(suite.tests)) {
144
144
  if (testKey === 'undefined') { // fix cucumber hooks crashing reporter (INFO: we may not need this anymore)
145
145
  continue;
146
146
  }
@@ -185,13 +185,14 @@ class JunitReporter extends WDIOReporter {
185
185
  testCase.failure();
186
186
  }
187
187
  const output = this._getStandardOutput(test);
188
- if (output)
188
+ if (output) {
189
189
  testCase.standardOutput(`\n${output}\n`);
190
+ }
190
191
  }
191
192
  return builder;
192
193
  }
193
194
  _buildJunitXml(runner) {
194
- let builder = junit.newBuilder();
195
+ const builder = junit.newBuilder();
195
196
  if (runner.config.hostname !== undefined && runner.config.hostname.indexOf('browserstack') > -1) {
196
197
  // NOTE: deviceUUID is used to build sanitizedCapabilities resulting in a ever-changing package name in runner.sanitizedCapabilities when running Android tests under Browserstack. (i.e. ht79v1a03938.android.9)
197
198
  // NOTE: platformVersion is used to build sanitizedCapabilities which can be incorrect and includes a minor version for iOS which is not guaranteed to be the same under Browserstack.
@@ -231,7 +232,7 @@ class JunitReporter extends WDIOReporter {
231
232
  return builder.build();
232
233
  }
233
234
  _buildOrderedReport(builder, runner, specFileName, type, isCucumberFrameworkRunner) {
234
- for (let suiteKey of Object.keys(this.suites)) {
235
+ for (const suiteKey of Object.keys(this.suites)) {
235
236
  /**
236
237
  * ignore root before all
237
238
  */
@@ -250,7 +251,7 @@ class JunitReporter extends WDIOReporter {
250
251
  return builder;
251
252
  }
252
253
  _getStandardOutput(test) {
253
- let standardOutput = [];
254
+ const standardOutput = [];
254
255
  test.output.forEach((data) => {
255
256
  switch (data.type) {
256
257
  case 'command':
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,KAAK,YAAsB,GAAG,QAyC1C,CAAA"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,KAAK,YAAsB,GAAG,QA2C1C,CAAA"}
package/build/utils.js CHANGED
@@ -5,8 +5,9 @@ const ARRLENGTH = 10;
5
5
  const STRINGLIMIT = 1000;
6
6
  const STRINGTRUNCATE = 200;
7
7
  export const limit = function (rawVal) {
8
- if (!rawVal)
8
+ if (!rawVal) {
9
9
  return rawVal;
10
+ }
10
11
  // Ensure we're working with a copy
11
12
  let val = JSON.parse(stringify(rawVal));
12
13
  const type = Object.prototype.toString.call(val);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wdio/junit-reporter",
3
- "version": "8.0.11",
3
+ "version": "8.0.14",
4
4
  "description": "A WebdriverIO reporter that creates Jenkins compatible XML based JUnit reports",
5
5
  "author": "Christian Bromann <mail@bromann.dev>",
6
6
  "homepage": "https://github.com/webdriverio/webdriverio/tree/main/packages/wdio-junit-reporter",
@@ -30,8 +30,8 @@
30
30
  "dependencies": {
31
31
  "@types/json-stringify-safe": "^5.0.0",
32
32
  "@types/validator": "^13.7.2",
33
- "@wdio/reporter": "8.0.11",
34
- "@wdio/types": "8.0.11",
33
+ "@wdio/reporter": "8.0.14",
34
+ "@wdio/types": "8.0.14",
35
35
  "json-stringify-safe": "^5.0.1",
36
36
  "junit-report-builder": "^3.0.0",
37
37
  "validator": "^13.7.0"
@@ -39,5 +39,5 @@
39
39
  "publishConfig": {
40
40
  "access": "public"
41
41
  },
42
- "gitHead": "22627575a41d9dc7415a2441bd894c0419725334"
42
+ "gitHead": "ab58bc79c1df2e146d02a68ee444766ec371e6d2"
43
43
  }