@wdio/junit-reporter 10.0.0-alpha.149 → 10.0.0-alpha.18

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/README.md CHANGED
@@ -149,23 +149,18 @@ export const config = {
149
149
  The following options are supported:
150
150
 
151
151
  ### outputDir
152
-
153
- <Option type="String">
154
-
155
152
  Define a directory where your XML files should get stored. Ignored if either `logFile` or `setLogFile` are defined.
156
153
 
157
- </Option>
154
+ Type: `String`
158
155
 
159
156
  ### outputFileFormat
160
-
161
- <Option type="Object" default={`(opts) => \`wdio-\${opts.cid}-junit-reporter.log\``}>
162
-
163
157
  Function for defining the filename format for the reporter log files. Ignored if either `logFile` or `setLogFile`
164
158
  are defined.
165
159
 
166
160
  The function accepts an object input parameter with the `cid` and `capabilities` keys.
167
161
 
168
- </Option>
162
+ Type: `Object`<br />
163
+ Default: ``(opts) => `wdio-${opts.cid}-junit-reporter.log` ``<br />
169
164
  Example:
170
165
  ```js
171
166
  // wdio.conf.js
@@ -180,13 +175,10 @@ export const config = {
180
175
  ```
181
176
 
182
177
  ### logFile
183
-
184
- <Option type="String">
185
-
186
178
  Path to the reporter log file relative to the current directory. Overrides `outputDir` and `outputFileFormat`.
187
179
  Ignored if `setLogFile` is defined.
188
180
 
189
- </Option>
181
+ Type: `String`<br />
190
182
  Example:
191
183
  ```js
192
184
  // wdio.conf.js
@@ -200,14 +192,11 @@ export const config = {
200
192
  ```
201
193
 
202
194
  ### setLogFile
203
-
204
- <Option type="Object">
205
-
206
195
  Function for defining the path for the reporter log files. Overrides `outputDir`, `outputFileFormat`, and `logFile`.
207
196
 
208
197
  The function accepts two input parameters: `cid` and `name` (the reporter name, set to `junit`).
209
198
 
210
- </Option>
199
+ Type: `Object`<br />
211
200
  Example:
212
201
  ```js
213
202
  // wdio.conf.js
@@ -221,32 +210,25 @@ export const config = {
221
210
  ```
222
211
 
223
212
  ### stdout
224
-
225
- <Option type="boolean" default="false">
226
-
227
213
  Output the generated XML to the console instead of creating a log file.
228
214
 
229
- </Option>
215
+ Type: `boolean`<br />
216
+ Default: `false`
230
217
 
231
218
  ### writeStream
232
-
233
- <Option type="WriteStream">
234
-
235
219
  Set a stream to which the generated XML should be output, instead of creating a log file.
236
220
 
237
221
  Note: `logFile` must not be set, unless `stdout` is set to `true`.
238
222
 
239
- </Option>
223
+ Type: `WriteStream`
240
224
 
241
225
  ### suiteNameFormat
242
-
243
- <Option type="Regex | Object" default="/[^a-zA-Z0-9@]+/">
244
-
245
226
  Format the generated name of a test suite, using custom regex or a function.
246
227
 
247
228
  The function accepts an object input parameter with the `name` and `suite` keys.
248
229
 
249
- </Option>
230
+ Type: `Regex | Object`,<br />
231
+ Default: `/[^a-zA-Z0-9@]+/`<br />
250
232
  Example with Regex:
251
233
  ```js
252
234
  // wdio.conf.js
@@ -273,15 +255,12 @@ export const config = {
273
255
  ```
274
256
 
275
257
  ### classNameFormat
276
-
277
- <Option type="Object">
278
-
279
258
  Format the generated classname of a test case.
280
259
 
281
260
  The function accepts an object input parameter with the [`packageName`](#packagename), `activeFeatureName`
282
261
  (Cucumber only), and `suite` (non-Cucumber only) keys.
283
262
 
284
- </Option>
263
+ Type: `Object`<br />
285
264
  Default (Cucumber): ``(opts) => `${opts.packageName}${opts.activeFeatureName}` ``<br />
286
265
  Default (others): ``(opts) => `${opts.packageName}.${(opts.suite.fullTitle || opts.suite.title).replace(/\s/g, '_')}` ``<br />
287
266
  Example (Cucumber):
@@ -309,14 +288,14 @@ export const config = {
309
288
  };
310
289
  ```
311
290
 
312
- ### addFileAttribute
313
291
 
314
- <Option type="Boolean" default="false">
292
+ ### addFileAttribute
315
293
 
316
294
  Adds a `file` attribute to each testcase. The value of this attribute matches the filepath property of the parent test
317
295
  suite. This config is primarily for CircleCI, but may break on other CI platforms.
318
296
 
319
- </Option>
297
+ Type: `Boolean`<br />
298
+ Default: `false`<br />
320
299
  Example simplified XML:
321
300
  ```xml
322
301
  <testsuite>
@@ -331,11 +310,9 @@ Example simplified XML:
331
310
 
332
311
  ### packageName
333
312
 
334
- <Option type="String">
335
-
336
313
  You can break out packages by an additional level by setting `'packageName'`. For example, if you wanted to iterate over a test suite with a different environment variable set:
337
314
 
338
- </Option>
315
+ Type: `String`<br />
339
316
  Default (Cucumber): `CucumberJUnitReport-${sanitizedCapabilities}`<br />
340
317
  Default (others): `${sanitizedCapabilities}`<br />
341
318
  Example:
@@ -354,8 +331,6 @@ export const config = {
354
331
 
355
332
  ### errorOptions
356
333
 
357
- <Option type="Object" default={`errorOptions: { error: "message" }`}>
358
-
359
334
  Allows to set various combinations of error notifications inside xml.<br />
360
335
  Given a Jasmine test like `expect(true).toBe(false, 'my custom message')` you will get this test error:
361
336
 
@@ -372,7 +347,8 @@ Given a Jasmine test like `expect(true).toBe(false, 'my custom message')` you wi
372
347
 
373
348
  Therefore you can choose *which* key will be used *where*, see the example below.
374
349
 
375
- </Option>
350
+ Type: `Object`,<br />
351
+ Default: `errorOptions: { error: "message" }`<br />
376
352
  Example:
377
353
 
378
354
  ```js
@@ -393,11 +369,10 @@ export const config = {
393
369
 
394
370
  ### addWorkerLogs
395
371
 
396
- <Option type="Boolean" default="false">
397
-
398
372
  Attach console logs from the test in the reporter.
399
373
 
400
- </Option>
374
+ Type: `Boolean`<br />
375
+ Default: `false`<br />
401
376
  Example:
402
377
 
403
378
  ```js
@@ -451,5 +426,3 @@ If there is no such post-build step in your CI system, there is probably a plugi
451
426
  ----
452
427
 
453
428
  For more information on WebdriverIO see the [homepage](https://webdriver.io).
454
-
455
-
package/build/index.js CHANGED
@@ -331,7 +331,7 @@ ${stepsOutput}
331
331
  this._addAmbiguousBasenameSuites(builder, runner, isCucumberFrameworkRunner, assignedSuiteKeys);
332
332
  return builder.build();
333
333
  }
334
- _buildOrderedReport(builder, runner, specFileName, type, isCucumberFrameworkRunner, assignedSuiteKeys) {
334
+ _buildOrderedReport(builder, runner, specFileName, type, isCucumberFrameworkRunner, assignedSuiteKeys = /* @__PURE__ */ new Set()) {
335
335
  const suiteKeys = Object.keys(this.suites);
336
336
  if (suiteKeys.length === 0) {
337
337
  if (!isCucumberFrameworkRunner || isCucumberFrameworkRunner && type === "feature") {
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@wdio/junit-reporter",
3
- "version": "10.0.0-alpha.149+ce13bea83",
3
+ "version": "10.0.0-alpha.18+dbf0f4971",
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",
7
7
  "license": "MIT",
8
8
  "engines": {
9
- "node": ">=22.19.0"
9
+ "node": ">=18.20.0"
10
10
  },
11
11
  "repository": {
12
12
  "type": "git",
@@ -33,12 +33,12 @@
33
33
  "require": "./build/index.cjs"
34
34
  }
35
35
  },
36
- "typeScriptVersion": "6.0.3",
36
+ "typeScriptVersion": "3.8.3",
37
37
  "dependencies": {
38
- "@wdio/reporter": "10.0.0-alpha.149+ce13bea83",
39
- "@wdio/types": "10.0.0-alpha.149+ce13bea83",
38
+ "@wdio/reporter": "10.0.0-alpha.18+dbf0f4971",
39
+ "@wdio/types": "10.0.0-alpha.18+dbf0f4971",
40
40
  "json-stringify-safe": "^5.0.1",
41
- "junit-report-builder": "^5.1.2"
41
+ "junit-report-builder": "^5.1.1"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@types/json-stringify-safe": "^5.0.0"
@@ -46,5 +46,5 @@
46
46
  "publishConfig": {
47
47
  "access": "public"
48
48
  },
49
- "gitHead": "ce13bea839fb037eceda429dbf94cd387b7c3584"
49
+ "gitHead": "dbf0f497130676040ce4212d9cf6459adfe16c42"
50
50
  }
package/AGENTS.md DELETED
@@ -1,20 +0,0 @@
1
- # @wdio/junit-reporter
2
-
3
- JUnit XML reporter. It extends `@wdio/reporter`. User docs are this package's `README.md`.
4
-
5
- ## Commands
6
-
7
- ```sh
8
- pnpm run test:package wdio-junit-reporter
9
- ```
10
-
11
- CJS `addProperty` load check: `pnpm --filter @wdio/test-interop-cjs run test:junit-reporter`.
12
-
13
- ## Test ownership
14
-
15
- - JUnit XML shape (suites, failures, skips, Cucumber scenarios, BrowserStack package names, and file association) is owned by `tests/reporter.test.ts` through `_buildJunitXml`. Keep those snapshots. Do not stub the suite builders and assert the stub.
16
- - `onRunnerEnd` must write the built report. Assert that document. A mocked `undefined` snapshot does not.
17
- - Whitespace-stripped snapshots do not lock command-log spacing. Exact `COMMAND:` / `RESULT:` text stays on the stdout test.
18
- - `addProperty` is the public worker API (process event `junit:addProperty`). Call `addProperty`, not the private listener.
19
- - `addWorkerLogs` is owned by writing to `stdout` while a test is current, then restoring `stdout.write`.
20
- - The CJS interop check uses `assert.equal(typeof fn, 'function')`. `assert(typeof fn, 'function')` cannot fail.