@wdio/browser-runner 8.28.5 → 8.28.7

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.
@@ -1 +1 @@
1
- {"version":3,"file":"mocha.d.ts","sourceRoot":"","sources":["../../../src/browser/frameworks/mocha.ts"],"names":[],"mappings":"AA6BA,qBAAa,cAAe,SAAQ,WAAW;;;IAyB3C,MAAM,KAAK,kBAAkB,aAE5B;IAED,IAAI,IAAI,WAEP;IAED,iBAAiB;IAWjB,wBAAwB,CAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO;IAatE,GAAG;CAgIZ"}
1
+ {"version":3,"file":"mocha.d.ts","sourceRoot":"","sources":["../../../src/browser/frameworks/mocha.ts"],"names":[],"mappings":"AA6BA,qBAAa,cAAe,SAAQ,WAAW;;;IAyB3C,MAAM,KAAK,kBAAkB,aAE5B;IAED,IAAI,IAAI,WAEP;IAED,iBAAiB;IAWjB,wBAAwB,CAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO;IAatE,GAAG;CAwIZ"}
@@ -107,16 +107,18 @@ export class MochaFramework extends HTMLElement {
107
107
  setupEnv(cid, window.__wdioEnv__.args, beforeTest, beforeHook, afterTest, afterHook);
108
108
  const self = this;
109
109
  const mochaBeforeHook = globalThis.before || globalThis.suiteSetup;
110
- mochaBeforeHook(function () {
111
- self.#getHook('beforeSuite')({
112
- ...this.test?.parent?.suites[0],
110
+ mochaBeforeHook(async function () {
111
+ const { title, tests, pending, delayed } = this.test?.parent?.suites[0] || {};
112
+ await self.#getHook('beforeSuite')({
113
+ ...({ title, tests, pending, delayed }),
113
114
  file,
114
115
  });
115
116
  });
116
117
  const mochaAfterHook = globalThis.after || globalThis.suiteTeardown;
117
- mochaAfterHook(function () {
118
- self.#getHook('afterSuite')({
119
- ...this.test?.parent?.suites[0],
118
+ mochaAfterHook(async function () {
119
+ const { title, tests, pending, delayed } = this.test?.parent?.suites[0] || {};
120
+ await self.#getHook('afterSuite')({
121
+ ...({ title, tests, pending, delayed }),
120
122
  file,
121
123
  duration: Date.now() - startTime
122
124
  });
@@ -143,8 +145,7 @@ export class MochaFramework extends HTMLElement {
143
145
  /**
144
146
  * propagate results to browser so it can be picked up by the runner
145
147
  */
146
- window.__wdioEvents__ = this.#runnerEvents;
147
- window.__wdioFailures__ = failures;
148
+ this.#sendTestReport({ failures, events: this.#runnerEvents });
148
149
  console.log(`[WDIO] Finished test suite in ${Date.now() - startTime}ms`);
149
150
  }
150
151
  #handleSocketMessage(message) {
@@ -180,6 +181,12 @@ export class MochaFramework extends HTMLElement {
180
181
  value: JSON.parse(safeStringify(value))
181
182
  };
182
183
  }
184
+ #sendTestReport(value) {
185
+ import.meta.hot?.send(WDIO_EVENT_NAME, {
186
+ type: MESSAGE_TYPES.browserTestResult,
187
+ value: JSON.parse(safeStringify(value))
188
+ });
189
+ }
183
190
  }
184
191
  const template = document.createElement('template');
185
192
  template.innerHTML = /*html*/ `
@@ -6,9 +6,6 @@ declare global {
6
6
  WDIO_EVENT_NAME: string;
7
7
  __wdioErrors__: WDIOErrorEvent[];
8
8
  __wdioSpec__: string;
9
- __wdioFailures__: number;
10
- __wdioEvents__: any[];
11
- __wdioConnectPromise__: Promise<WebSocket>;
12
9
  __wdioMockCache__: Map<string, any>;
13
10
  }
14
11
  }
@@ -1 +1 @@
1
- {"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../src/browser/setup.ts"],"names":[],"mappings":"AAOA,OAAO,uBAAuB,CAAA;AAI9B,KAAK,cAAc,GAAG,IAAI,CAAC,UAAU,EAAE,UAAU,GAAG,SAAS,CAAC,CAAA;AAC9D,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,MAAM;QACZ,KAAK,CAAC,EAAE,GAAG,CAAA;QACX,eAAe,EAAE,MAAM,CAAA;QACvB,cAAc,EAAE,cAAc,EAAE,CAAA;QAChC,YAAY,EAAE,MAAM,CAAA;QACpB,gBAAgB,EAAE,MAAM,CAAA;QACxB,cAAc,EAAE,GAAG,EAAE,CAAA;QACrB,sBAAsB,EAAE,OAAO,CAAC,SAAS,CAAC,CAAA;QAC1C,iBAAiB,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;KACtC;CACJ"}
1
+ {"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../src/browser/setup.ts"],"names":[],"mappings":"AAOA,OAAO,uBAAuB,CAAA;AAI9B,KAAK,cAAc,GAAG,IAAI,CAAC,UAAU,EAAE,UAAU,GAAG,SAAS,CAAC,CAAA;AAC9D,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,MAAM;QACZ,KAAK,CAAC,EAAE,GAAG,CAAA;QACX,eAAe,EAAE,MAAM,CAAA;QACvB,cAAc,EAAE,cAAc,EAAE,CAAA;QAChC,YAAY,EAAE,MAAM,CAAA;QACpB,iBAAiB,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;KACtC;CACJ"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wdio/browser-runner",
3
- "version": "8.28.5",
3
+ "version": "8.28.7",
4
4
  "description": "A WebdriverIO runner to run unit tests tests in the browser.",
5
5
  "author": "Christian Bromann <mail@bromann.dev>",
6
6
  "homepage": "https://github.com/webdriverio/webdriverio/tree/main/packages/wdio-browser-runner",
@@ -34,14 +34,14 @@
34
34
  "@originjs/vite-plugin-commonjs": "^1.0.3",
35
35
  "@types/istanbul-lib-source-maps": "^4.0.1",
36
36
  "@vitest/spy": "^1.0.1",
37
- "@wdio/globals": "8.28.4",
38
- "@wdio/local-runner": "8.28.4",
37
+ "@wdio/globals": "8.28.6",
38
+ "@wdio/local-runner": "8.28.7",
39
39
  "@wdio/logger": "8.28.0",
40
- "@wdio/mocha-framework": "8.28.0",
40
+ "@wdio/mocha-framework": "8.28.6",
41
41
  "@wdio/protocols": "^8.24.12",
42
- "@wdio/runner": "8.28.4",
43
- "@wdio/types": "8.28.0",
44
- "@wdio/utils": "8.28.0",
42
+ "@wdio/runner": "8.28.7",
43
+ "@wdio/types": "8.28.6",
44
+ "@wdio/utils": "8.28.6",
45
45
  "deepmerge-ts": "^5.0.0",
46
46
  "expect": "^29.7.0",
47
47
  "expect-webdriverio": "^4.8.1",
@@ -59,8 +59,8 @@
59
59
  "vite": "~4.5.0",
60
60
  "vite-plugin-istanbul": "^5.0.0",
61
61
  "vite-plugin-top-level-await": "^1.3.0",
62
- "webdriver": "8.28.0",
63
- "webdriverio": "8.28.4"
62
+ "webdriver": "8.28.6",
63
+ "webdriverio": "8.28.6"
64
64
  },
65
65
  "scripts": {
66
66
  "prepare": "rimraf node_modules/@wdio/config node_modules/@wdio/repl node_modules/@wdio/utils"
@@ -68,5 +68,5 @@
68
68
  "publishConfig": {
69
69
  "access": "public"
70
70
  },
71
- "gitHead": "8bafb17741c8e221ee07be56222fbf75fb65c83b"
71
+ "gitHead": "17828852f2b687ee32eaa1a16dbd14d0fd9ec58b"
72
72
  }