@wdio/browser-runner 8.8.1 → 8.8.4

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":"AA8BA,qBAAa,cAAe,SAAQ,WAAW;;;IAuB3C,MAAM,KAAK,kBAAkB,aAE5B;IAED,iBAAiB;IAWjB,wBAAwB,CAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO;IAatE,GAAG,CAAE,MAAM,EAAE,SAAS;CAkG/B"}
1
+ {"version":3,"file":"mocha.d.ts","sourceRoot":"","sources":["../../../src/browser/frameworks/mocha.ts"],"names":[],"mappings":"AA8BA,qBAAa,cAAe,SAAQ,WAAW;;;IAuB3C,MAAM,KAAK,kBAAkB,aAE5B;IAED,iBAAiB;IAWjB,wBAAwB,CAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO;IAatE,GAAG,CAAE,MAAM,EAAE,SAAS;CAoG/B"}
@@ -81,13 +81,15 @@ export class MochaFramework extends HTMLElement {
81
81
  const afterTest = this.#getHook('afterTest');
82
82
  setupEnv(cid, window.__wdioEnv__.args, beforeTest, beforeHook, afterTest, afterHook);
83
83
  const self = this;
84
- before(function () {
84
+ const mochaBeforeHook = globalThis.before || globalThis.suiteSetup;
85
+ mochaBeforeHook(function () {
85
86
  self.#getHook('beforeSuite')({
86
87
  ...this.test?.parent?.suites[0],
87
88
  file,
88
89
  });
89
90
  });
90
- after(function () {
91
+ const mochaAfterHook = globalThis.after || globalThis.suiteTeardown;
92
+ mochaAfterHook(function () {
91
93
  self.#getHook('afterSuite')({
92
94
  ...this.test?.parent?.suites[0],
93
95
  file,
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/vite/utils.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@ -8,6 +8,7 @@ const log = logger('@wdio/browser-runner');
8
8
  export async function getTemplate(options, env, spec, processEnv = process.env) {
9
9
  const root = options.rootDir || process.cwd();
10
10
  const rootFileUrl = url.pathToFileURL(root).href;
11
+ const isHeadless = options.headless || Boolean(process.env.CI);
11
12
  let vueDeps = '';
12
13
  if (options.preset === 'vue') {
13
14
  try {
@@ -88,7 +89,7 @@ export async function getTemplate(options, env, spec, processEnv = process.env)
88
89
  ${vueDeps}
89
90
  </head>
90
91
  <body>
91
- <mocha-framework spec="${spec}" ${process.env.CI ? 'minified' : ''}></mocha-framework>
92
+ <mocha-framework spec="${spec}" ${isHeadless ? 'style="display: none"' : ''}></mocha-framework>
92
93
  <script type="module">
93
94
  window.process.env = ${JSON.stringify(processEnv)}
94
95
  </script>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wdio/browser-runner",
3
- "version": "8.8.1",
3
+ "version": "8.8.4",
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",
@@ -35,13 +35,13 @@
35
35
  "@types/istanbul-lib-source-maps": "^4.0.1",
36
36
  "@types/node": "^18.15.3",
37
37
  "@vitest/spy": "^0.30.0",
38
- "@wdio/globals": "8.8.1",
39
- "@wdio/local-runner": "8.8.1",
38
+ "@wdio/globals": "8.8.4",
39
+ "@wdio/local-runner": "8.8.4",
40
40
  "@wdio/logger": "8.6.6",
41
- "@wdio/mocha-framework": "8.8.0",
41
+ "@wdio/mocha-framework": "8.8.4",
42
42
  "@wdio/protocols": "8.8.1",
43
- "@wdio/types": "8.8.0",
44
- "@wdio/utils": "8.8.0",
43
+ "@wdio/types": "8.8.4",
44
+ "@wdio/utils": "8.8.4",
45
45
  "ast-types": "^0.14.2",
46
46
  "deepmerge-ts": "^5.0.0",
47
47
  "expect-webdriverio": "^4.1.2",
@@ -59,8 +59,8 @@
59
59
  "vite": "^4.2.0",
60
60
  "vite-plugin-istanbul": "^4.0.1",
61
61
  "vite-plugin-top-level-await": "^1.3.0",
62
- "webdriver": "8.8.1",
63
- "webdriverio": "8.8.1",
62
+ "webdriver": "8.8.4",
63
+ "webdriverio": "8.8.4",
64
64
  "ws": "^8.13.0"
65
65
  },
66
66
  "scripts": {
@@ -71,7 +71,7 @@
71
71
  },
72
72
  "devDependencies": {
73
73
  "@types/ws": "^8.5.4",
74
- "@wdio/runner": "8.8.1"
74
+ "@wdio/runner": "8.8.4"
75
75
  },
76
- "gitHead": "9119f9fe5ae85b0c399a58e4e09ca3a824daa305"
76
+ "gitHead": "e88a296000de70344fbf19d0d63a54cb1a617427"
77
77
  }