@wdio/reporter 9.32.0 → 10.0.0-alpha.149

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/AGENTS.md ADDED
@@ -0,0 +1,55 @@
1
+ # @wdio/reporter
2
+
3
+ Base class for reporters. Concrete reporters (`wdio-spec-reporter`,
4
+ `wdio-junit-reporter`, …) extend this package.
5
+
6
+ ## When to edit which package
7
+
8
+ | Change | Package |
9
+ |--------|---------|
10
+ | Runner events, output path, base lifecycle | `@wdio/reporter` |
11
+ | Spec / JUnit / Allure / … formatting | that reporter package |
12
+ | How the runner constructs reporters | `@wdio/runner` |
13
+
14
+ ## Commands
15
+
16
+ ```sh
17
+ pnpm run test:package wdio-reporter
18
+ pnpm run test:package wdio-spec-reporter
19
+ pnpm run test:smoke customReporterString
20
+ pnpm run test:smoke customReporterObject
21
+ pnpm run test:smoke reporterTestrunner
22
+ ```
23
+
24
+ User-facing reporter docs are the package `README.md`, ingested by
25
+ `infra/docs/src/packagesDocs.ts`.
26
+
27
+ ## Guardrails
28
+
29
+ - New reporters: `pnpm run create` and extend `@wdio/reporter`.
30
+ - Do not reach into `@wdio/runner` internals from a reporter. Consume the
31
+ documented event API only.
32
+ - Smoke tests are the right proof for constructor / CLI string vs object
33
+ config; unit tests are enough for formatting helpers.
34
+
35
+ ## Spec reporter test ownership
36
+
37
+ `packages/wdio-spec-reporter/tests/index.test.ts` owns spec formatting.
38
+ Assert the written report. Do not lock private flags or `printCurrentStats`
39
+ call shape.
40
+
41
+ - `showPreface: false`, `onlyFailures`, and `sauceLabsSharableLinks: false`
42
+ must attach suites before asserting `write()`. Sauce job links also need
43
+ `runnerStat.instanceOptions`. An empty `write()` call list does not prove
44
+ the option. Default preface text belongs to the existing `printReport`
45
+ snapshots.
46
+ - Console-log filtering goes through the patched `stdout.write`. Assigning
47
+ `_consoleOutput` does not exercise the `mwebdriver` exclusion.
48
+ - Realtime reporting is the `reporterRealTime` payload on `process.send`.
49
+ The unit-test env var `WDIO_UNIT_TESTS` suppresses that send, so a test
50
+ of the payload has to unset it and restore it.
51
+ - `getHeaderDisplay` does not print spec paths.
52
+ - Default symbols and pass/fail/skip colors belong to the printed report.
53
+ Custom `symbols` belong on that same report. Keep the multi-remote
54
+ instance name `"app"`: combo formatting throws if that name is read as
55
+ an app capability.
package/build/index.cjs CHANGED
@@ -164,8 +164,7 @@ function createSupportsColor(stream, options = {}) {
164
164
  return translateLevel(level);
165
165
  }
166
166
  var supportsColor = {
167
- stdout: createSupportsColor({ isTTY: import_node_tty.default.isatty(1) }),
168
- stderr: createSupportsColor({ isTTY: import_node_tty.default.isatty(2) })
167
+ stdout: createSupportsColor({ isTTY: import_node_tty.default.isatty(1) })
169
168
  };
170
169
  var supportsColor_default = supportsColor;
171
170
 
@@ -209,15 +208,15 @@ function sanitizeCaps(caps) {
209
208
  let result;
210
209
  result = caps["appium:deviceName"] || caps.deviceName ? [
211
210
  sanitizeString(caps.platformName),
212
- // @ts-expect-error outdated JSONWP capabilities
211
+ // @ts-expect-error legacy capability names
213
212
  sanitizeString(caps["appium:deviceName"] || caps.deviceName),
214
213
  sanitizeString(caps["appium:platformVersion"]),
215
214
  sanitizeString(caps["appium:app"])
216
215
  ] : [
217
216
  sanitizeString(caps.browserName),
218
- // @ts-expect-error outdated JSONWP capabilities
217
+ // @ts-expect-error legacy capability names
219
218
  sanitizeString(caps.version || caps.browserVersion),
220
- // @ts-expect-error outdated JSONWP capabilities
219
+ // @ts-expect-error legacy capability names
221
220
  sanitizeString(caps.platform || caps.platformName),
222
221
  sanitizeString(caps["appium:app"])
223
222
  ];
@@ -459,7 +458,7 @@ var RunnerStats = class extends RunnableStats {
459
458
  config;
460
459
  specs;
461
460
  sessionId;
462
- isMultiremote;
461
+ isMultiRemote;
463
462
  instanceOptions;
464
463
  retry;
465
464
  failures;
@@ -473,7 +472,7 @@ var RunnerStats = class extends RunnableStats {
473
472
  this.config = runner.config;
474
473
  this.specs = runner.specs;
475
474
  this.sessionId = runner.sessionId;
476
- this.isMultiremote = runner.isMultiremote;
475
+ this.isMultiRemote = runner.isMultiRemote;
477
476
  this.instanceOptions = runner.instanceOptions;
478
477
  this.retry = runner.retry;
479
478
  }
package/build/index.js CHANGED
@@ -124,8 +124,7 @@ function createSupportsColor(stream, options = {}) {
124
124
  return translateLevel(level);
125
125
  }
126
126
  var supportsColor = {
127
- stdout: createSupportsColor({ isTTY: tty.isatty(1) }),
128
- stderr: createSupportsColor({ isTTY: tty.isatty(2) })
127
+ stdout: createSupportsColor({ isTTY: tty.isatty(1) })
129
128
  };
130
129
  var supportsColor_default = supportsColor;
131
130
 
@@ -169,15 +168,15 @@ function sanitizeCaps(caps) {
169
168
  let result;
170
169
  result = caps["appium:deviceName"] || caps.deviceName ? [
171
170
  sanitizeString(caps.platformName),
172
- // @ts-expect-error outdated JSONWP capabilities
171
+ // @ts-expect-error legacy capability names
173
172
  sanitizeString(caps["appium:deviceName"] || caps.deviceName),
174
173
  sanitizeString(caps["appium:platformVersion"]),
175
174
  sanitizeString(caps["appium:app"])
176
175
  ] : [
177
176
  sanitizeString(caps.browserName),
178
- // @ts-expect-error outdated JSONWP capabilities
177
+ // @ts-expect-error legacy capability names
179
178
  sanitizeString(caps.version || caps.browserVersion),
180
- // @ts-expect-error outdated JSONWP capabilities
179
+ // @ts-expect-error legacy capability names
181
180
  sanitizeString(caps.platform || caps.platformName),
182
181
  sanitizeString(caps["appium:app"])
183
182
  ];
@@ -419,7 +418,7 @@ var RunnerStats = class extends RunnableStats {
419
418
  config;
420
419
  specs;
421
420
  sessionId;
422
- isMultiremote;
421
+ isMultiRemote;
423
422
  instanceOptions;
424
423
  retry;
425
424
  failures;
@@ -433,7 +432,7 @@ var RunnerStats = class extends RunnableStats {
433
432
  this.config = runner.config;
434
433
  this.specs = runner.specs;
435
434
  this.sessionId = runner.sessionId;
436
- this.isMultiremote = runner.isMultiremote;
435
+ this.isMultiRemote = runner.isMultiRemote;
437
436
  this.instanceOptions = runner.instanceOptions;
438
437
  this.retry = runner.retry;
439
438
  }
@@ -11,7 +11,7 @@ export default class RunnerStats extends RunnableStats {
11
11
  config: Options.Testrunner;
12
12
  specs: string[];
13
13
  sessionId: string;
14
- isMultiremote: boolean;
14
+ isMultiRemote: boolean;
15
15
  instanceOptions: Record<string, Options.WebdriverIO>;
16
16
  retry?: number;
17
17
  failures?: number;
@@ -3,24 +3,6 @@
3
3
  *
4
4
  * This file was imported due to lacking support of CJS environments in the original package.
5
5
  */
6
- interface Options {
7
- /**
8
- * By default it is `true`, which instructs `supportsColor()` to sniff `process.argv`
9
- * for the multitude of `--color` flags (see _Info_ below).
10
- * If `false`, then `process.argv` is not considered when determining color support.
11
- * @default true
12
- */
13
- sniffFlags?: boolean | undefined;
14
- isTTY?: boolean | undefined;
15
- }
16
- export declare function createSupportsColor(stream: {
17
- isTTY?: boolean;
18
- }, options?: Options): false | {
19
- level: number;
20
- hasBasic: boolean;
21
- has256: boolean;
22
- has16m: boolean;
23
- };
24
6
  declare const supportsColor: {
25
7
  stdout: boolean | {
26
8
  level: number;
@@ -28,12 +10,6 @@ declare const supportsColor: {
28
10
  has256: boolean;
29
11
  has16m: boolean;
30
12
  };
31
- stderr: boolean | {
32
- level: number;
33
- hasBasic: boolean;
34
- has256: boolean;
35
- has16m: boolean;
36
- };
37
13
  };
38
14
  export default supportsColor;
39
15
  //# sourceMappingURL=supportsColor.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"supportsColor.d.ts","sourceRoot":"","sources":["../src/supportsColor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAeH,UAAU,OAAO;IACb;;;;;OAKG;IACH,UAAU,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACjC,KAAK,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CAC/B;AA4JD,wBAAgB,mBAAmB,CAAC,MAAM,EAAE;IAAE,KAAK,CAAC,EAAE,OAAO,CAAA;CAAE,EAAE,OAAO,GAAE,OAAY;;;;;EAOrF;AAED,QAAA,MAAM,aAAa;;;;;;;;;;;;;CAGlB,CAAA;AAED,eAAe,aAAa,CAAA"}
1
+ {"version":3,"file":"supportsColor.d.ts","sourceRoot":"","sources":["../src/supportsColor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AA6LH,QAAA,MAAM,aAAa;;;;;;;CAElB,CAAA;AAED,eAAe,aAAa,CAAA"}
package/build/types.d.ts CHANGED
@@ -18,12 +18,6 @@ export interface BeforeCommandArgs extends CommandArgs {
18
18
  }
19
19
  export interface AfterCommandArgs extends CommandArgs {
20
20
  result: unknown;
21
- /**
22
- * @deprecated Use `command` instead, moreover since the `onAfterCommand` was never called in the case of custom commands, it was breaking reports, and we do not emit this one in the fix!
23
- *
24
- * custom commands also send along the command name
25
- */
26
- name?: string;
27
21
  }
28
22
  export interface Argument {
29
23
  rows?: {
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,GAAG;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,WAAW;IACxB,SAAS,EAAE,MAAM,CAAA;IACjB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,QAAQ,CAAC,EAAE,MAAM,CAAA;IAEjB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,MAAM,CAAC,EAAE,OAAO,CAAA;CACnB;AAED,MAAM,WAAW,iBAAkB,SAAQ,WAAW;IAClD,IAAI,EAAE,OAAO,CAAA;CAChB;AAED,MAAM,WAAW,gBAAiB,SAAQ,WAAW;IACjD,MAAM,EAAE,OAAO,CAAA;IAEf;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,MAAM,WAAW,QAAQ;IACrB,IAAI,CAAC,EAAE;QACH,KAAK,EAAE,MAAM,EAAE,CAAA;KAClB,EAAE,CAAA;CACN"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,GAAG;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,WAAW;IACxB,SAAS,EAAE,MAAM,CAAA;IACjB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,QAAQ,CAAC,EAAE,MAAM,CAAA;IAEjB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,MAAM,CAAC,EAAE,OAAO,CAAA;CACnB;AAED,MAAM,WAAW,iBAAkB,SAAQ,WAAW;IAClD,IAAI,EAAE,OAAO,CAAA;CAChB;AAED,MAAM,WAAW,gBAAiB,SAAQ,WAAW;IACjD,MAAM,EAAE,OAAO,CAAA;CAClB;AAED,MAAM,WAAW,QAAQ;IACrB,IAAI,CAAC,EAAE;QACH,KAAK,EAAE,MAAM,EAAE,CAAA;KAClB,EAAE,CAAA;CACN"}
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@wdio/reporter",
3
- "version": "9.32.0",
3
+ "version": "10.0.0-alpha.149+ce13bea83",
4
4
  "description": "A WebdriverIO utility to help reporting all events",
5
5
  "author": "Christian Bromann <mail@bromann.dev>",
6
6
  "homepage": "https://github.com/webdriverio/webdriverio/tree/main/packages/wdio-reporter",
7
7
  "license": "MIT",
8
8
  "engines": {
9
- "node": ">=18.20.0"
9
+ "node": ">=22.19.0"
10
10
  },
11
11
  "repository": {
12
12
  "type": "git",
@@ -35,20 +35,18 @@
35
35
  "require": "./build/index.cjs"
36
36
  }
37
37
  },
38
- "typeScriptVersion": "3.8.3",
38
+ "typeScriptVersion": "6.0.3",
39
39
  "dependencies": {
40
- "@types/node": "^20.1.0",
41
- "@wdio/logger": "9.29.1",
42
- "@wdio/types": "9.32.0",
43
- "diff": "^8.0.2",
40
+ "@types/node": "^22.20.4",
41
+ "@wdio/types": "10.0.0-alpha.149+ce13bea83",
42
+ "diff": "^8.0.4",
44
43
  "object-inspect": "^1.12.0"
45
44
  },
46
45
  "devDependencies": {
47
46
  "@types/diff": "^8.0.0",
48
47
  "@types/object-inspect": "^1.8.1",
49
- "@types/supports-color": "^8.1.1",
50
48
  "@types/tmp": "^0.2.3",
51
- "tmp": "^0.2.1"
49
+ "tmp": "^0.2.7"
52
50
  },
53
- "gitHead": "5c2a318d9a5e8424a2f2de95df9374b89bda7936"
51
+ "gitHead": "ce13bea839fb037eceda429dbf94cd387b7c3584"
54
52
  }