@wdio/browser-runner 8.0.0-alpha.563 → 8.0.0-alpha.577

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":"AAWA,qBAAa,cAAc;;gBAKV,MAAM,EAAE,SAAS;IAqB9B,GAAG;CA0EN"}
1
+ {"version":3,"file":"mocha.d.ts","sourceRoot":"","sources":["../../../src/browser/frameworks/mocha.ts"],"names":[],"mappings":"AAUA,qBAAa,cAAc;;gBAKV,MAAM,EAAE,SAAS;IAqB9B,GAAG;CA0EN"}
@@ -1,6 +1,5 @@
1
1
  import Mocha from 'mocha';
2
2
  import stringify from 'fast-safe-stringify';
3
- // @ts-expect-error
4
3
  import { setupEnv, formatMessage } from '@wdio/mocha-framework/common';
5
4
  import { MESSAGE_TYPES, EVENTS } from '../../constants.js';
6
5
  const startTime = Date.now();
@@ -1 +1 @@
1
- {"version":3,"file":"testrunner.d.ts","sourceRoot":"","sources":["../../../src/vite/plugins/testrunner.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AA8ClC,wBAAgB,UAAU,CAAE,OAAO,EAAE,WAAW,CAAC,oBAAoB,GAAG,MAAM,CAiH7E"}
1
+ {"version":3,"file":"testrunner.d.ts","sourceRoot":"","sources":["../../../src/vite/plugins/testrunner.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AA6ClC,wBAAgB,UAAU,CAAE,OAAO,EAAE,WAAW,CAAC,oBAAoB,GAAG,MAAM,CA6G7E"}
@@ -1,12 +1,11 @@
1
1
  import url from 'node:url';
2
2
  import path from 'node:path';
3
3
  import logger from '@wdio/logger';
4
- import { createRequire } from 'node:module';
4
+ import { resolve } from 'import-meta-resolve';
5
5
  import { WebDriverProtocol, MJsonWProtocol, JsonWProtocol, AppiumProtocol, ChromiumProtocol, SauceLabsProtocol, SeleniumProtocol, GeckoProtocol, WebDriverBidiProtocol } from '@wdio/protocols';
6
6
  import { SESSIONS } from '../../constants.js';
7
7
  import { getTemplate, getErrorTemplate } from '../utils.js';
8
8
  const log = logger('@wdio/browser-runner:plugin');
9
- const require = createRequire(import.meta.url);
10
9
  const __dirname = url.fileURLToPath(new URL('.', import.meta.url));
11
10
  const commands = {
12
11
  ...WebDriverProtocol,
@@ -40,7 +39,7 @@ export function testrunner(options) {
40
39
  return {
41
40
  name: 'wdio:testrunner',
42
41
  enforce: 'pre',
43
- resolveId: (id) => {
42
+ resolveId: async (id) => {
44
43
  if (id === virtualModuleId) {
45
44
  return resolvedVirtualModuleId;
46
45
  }
@@ -51,10 +50,7 @@ export function testrunner(options) {
51
50
  * make sure WDIO imports are resolved properly as ESM module
52
51
  */
53
52
  if (id.startsWith('@wdio') || WDIO_PACKAGES.includes(id)) {
54
- if (id === '@wdio/mocha-framework/common') {
55
- return require.resolve('@wdio/mocha-framework').replace('index.js', 'common.js');
56
- }
57
- return require.resolve(id).replace('/cjs', '');
53
+ return url.fileURLToPath(await resolve(id, import.meta.url));
58
54
  }
59
55
  /**
60
56
  * mock out imports that we can't transpile into browser land
@@ -1,21 +1,21 @@
1
1
  import fs from 'node:fs/promises';
2
+ import url from 'node:url';
2
3
  import path from 'node:path';
3
- import { createRequire } from 'node:module';
4
+ import { resolve } from 'import-meta-resolve';
4
5
  export async function getTemplate(options, env, spec) {
5
6
  const root = options.rootDir || process.cwd();
6
- const require = createRequire(path.join(root, 'node_modules'));
7
7
  let vueDeps = '';
8
8
  if (options.preset === 'vue') {
9
9
  try {
10
- const vueDir = path.dirname(require.resolve('vue'));
10
+ const vueDir = path.dirname(url.fileURLToPath(await resolve('vue', url.pathToFileURL(root).href)));
11
11
  const vueScript = (await fs.readFile(path.join(vueDir, 'dist', 'vue.global.prod.js'), 'utf-8')).toString();
12
12
  vueDeps += /*html*/ `
13
13
  <script type="module">
14
14
  ${vueScript}
15
15
  window.Vue = Vue
16
16
  </script>`;
17
- const vueCompilerDir = path.dirname(require.resolve('@vue/compiler-dom'));
18
- const vueCompilerScript = (await fs.readFile(path.join(vueCompilerDir, 'dist', 'compiler-dom.global.prod.js'), 'utf-8')).toString();
17
+ const vueCompilerDir = path.dirname(url.fileURLToPath(await resolve('@vue/compiler-dom', url.pathToFileURL(root).href)));
18
+ const vueCompilerScript = (await fs.readFile(path.join(vueCompilerDir, 'dist', 'compiler-dom.global.prod.js'))).toString();
19
19
  vueDeps += /*html*/ `
20
20
  <script type="module">
21
21
  ${vueCompilerScript}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wdio/browser-runner",
3
- "version": "8.0.0-alpha.563+01b1cdcb3",
3
+ "version": "8.0.0-alpha.577+73cd77ef7",
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",
@@ -31,23 +31,24 @@
31
31
  "@esbuild-plugins/node-globals-polyfill": "^0.1.1",
32
32
  "@originjs/vite-plugin-commonjs": "^1.0.3",
33
33
  "@types/mocha": "^10.0.0",
34
- "@wdio/globals": "8.0.0-alpha.563+01b1cdcb3",
35
- "@wdio/local-runner": "8.0.0-alpha.563+01b1cdcb3",
36
- "@wdio/logger": "8.0.0-alpha.563+01b1cdcb3",
37
- "@wdio/mocha-framework": "8.0.0-alpha.563+01b1cdcb3",
38
- "@wdio/protocols": "8.0.0-alpha.563+01b1cdcb3",
39
- "@wdio/runner": "8.0.0-alpha.563+01b1cdcb3",
40
- "@wdio/types": "8.0.0-alpha.563+01b1cdcb3",
41
- "@wdio/utils": "8.0.0-alpha.563+01b1cdcb3",
34
+ "@wdio/globals": "8.0.0-alpha.577+73cd77ef7",
35
+ "@wdio/local-runner": "8.0.0-alpha.577+73cd77ef7",
36
+ "@wdio/logger": "8.0.0-alpha.577+73cd77ef7",
37
+ "@wdio/mocha-framework": "8.0.0-alpha.577+73cd77ef7",
38
+ "@wdio/protocols": "8.0.0-alpha.577+73cd77ef7",
39
+ "@wdio/runner": "8.0.0-alpha.577+73cd77ef7",
40
+ "@wdio/types": "8.0.0-alpha.577+73cd77ef7",
41
+ "@wdio/utils": "8.0.0-alpha.577+73cd77ef7",
42
42
  "deepmerge-ts": "^4.2.2",
43
43
  "expect-webdriverio": "^4.0.0-alpha.6",
44
44
  "fast-safe-stringify": "^2.1.1",
45
45
  "get-port": "^6.1.2",
46
+ "import-meta-resolve": "^2.1.0",
46
47
  "serialize-error": "^11.0.0",
47
48
  "vite": "^3.1.7",
48
49
  "vite-plugin-top-level-await": "^1.2.1",
49
- "webdriver": "8.0.0-alpha.563+01b1cdcb3",
50
- "webdriverio": "8.0.0-alpha.563+01b1cdcb3",
50
+ "webdriver": "8.0.0-alpha.577+73cd77ef7",
51
+ "webdriverio": "8.0.0-alpha.577+73cd77ef7",
51
52
  "ws": "^8.10.0"
52
53
  },
53
54
  "scripts": {
@@ -59,5 +60,5 @@
59
60
  "devDependencies": {
60
61
  "@types/ws": "^8.5.3"
61
62
  },
62
- "gitHead": "01b1cdcb32747d629c56fa2e7bb8b507f1ab16ec"
63
+ "gitHead": "73cd77ef7887819c56dc98932a0c34e8af10b64a"
63
64
  }