@wdio/mocha-framework 8.0.13 → 8.1.0

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/build/common.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { FormattedMessage, FrameworkMessage, MochaOpts } from './types';
1
+ import type { FormattedMessage, FrameworkMessage, MochaOpts } from './types.js';
2
2
  export declare function formatMessage(params: FrameworkMessage): FormattedMessage;
3
3
  /**
4
4
  * require external modules
@@ -1 +1 @@
1
- {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../src/common.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAc5E,wBAAgB,aAAa,CAAE,MAAM,EAAE,gBAAgB,oBA4EtD;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAE,IAAI,EAAE,MAAM,EAAE,EAAE,MAAM,oBAAa,kBAc1E;AAED,KAAK,IAAI,GAAG,QAAQ,GAAG,QAAQ,EAAE,CAAA;AACjC,wBAAgB,QAAQ,CAAE,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,kBA6B9H;AAED,wBAAsB,UAAU,CAAE,IAAI,EAAE,MAAM,gBAQ7C"}
1
+ {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../src/common.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAc/E,wBAAgB,aAAa,CAAE,MAAM,EAAE,gBAAgB,oBA4EtD;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAE,IAAI,EAAE,MAAM,EAAE,EAAE,MAAM,oBAAa,kBAc1E;AAED,KAAK,IAAI,GAAG,QAAQ,GAAG,QAAQ,EAAE,CAAA;AACjC,wBAAgB,QAAQ,CAAE,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,kBA6B9H;AAED,wBAAsB,UAAU,CAAE,IAAI,EAAE,MAAM,gBAQ7C"}
package/build/common.js CHANGED
@@ -12,7 +12,7 @@ import { INTERFACES, TEST_INTERFACES, MOCHA_TIMEOUT_MESSAGE } from './constants.
12
12
  const MOCHA_UI_TYPE_EXTRACTOR = /^(?:.*-)?([^-.]+)(?:.js)?$/;
13
13
  const DEFAULT_INTERFACE_TYPE = 'bdd';
14
14
  export function formatMessage(params) {
15
- let message = {
15
+ const message = {
16
16
  type: params.type
17
17
  };
18
18
  const mochaAllHooksIfPresent = params.payload?.title?.match(/^"(before|after)( all| each)?" hook/);
@@ -105,10 +105,11 @@ export function setupEnv(cid, options, beforeTest, beforeHook, afterTest, afterH
105
105
  // @ts-ignore
106
106
  hookArgsFn, isTest ? afterTest : afterHook, hookArgsFn, fnName, cid);
107
107
  });
108
- let { require = [], compilers = [] } = options;
108
+ let { require = [] } = options;
109
109
  if (typeof require === 'string') {
110
110
  require = [require];
111
111
  }
112
+ const { compilers = [] } = options;
112
113
  return requireExternalModules([...compilers, ...require]);
113
114
  }
114
115
  export async function loadModule(name) {
package/build/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- /// <reference types="node" />
1
+ /// <reference types="node" resolution-mode="require"/>
2
2
  import type { Capabilities, Services } from '@wdio/types';
3
- import type { MochaConfig, MochaOpts as MochaOptsImport, FrameworkMessage, MochaError } from './types';
3
+ import type { MochaConfig, MochaOpts as MochaOptsImport, FrameworkMessage, MochaError } from './types.js';
4
4
  import type { EventEmitter } from 'node:events';
5
5
  type EventTypes = 'hook' | 'test' | 'suite';
6
6
  /**
@@ -31,7 +31,7 @@ declare class MochaAdapter {
31
31
  * Hooks which are added as true Mocha hooks need to call done() to notify async
32
32
  */
33
33
  wrapHook(hookName: keyof Services.HookFunctions): () => Promise<void | unknown[]>;
34
- prepareMessage(hookName: keyof Services.HookFunctions): import("./types").FormattedMessage;
34
+ prepareMessage(hookName: keyof Services.HookFunctions): import("./types.js").FormattedMessage;
35
35
  emit(event: string, payload: any, err?: MochaError): void;
36
36
  getSyncEventIdStart(type: EventTypes): string;
37
37
  getSyncEventIdEnd(type: EventTypes): string;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAKA,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAIzD,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,IAAI,eAAe,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AACtG,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAK/C,KAAK,UAAU,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAA;AAG3C;;GAEG;AACH,cAAM,YAAY;IAcV,OAAO,CAAC,IAAI;IACZ,OAAO,CAAC,OAAO;IACf,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,aAAa;IACrB,OAAO,CAAC,SAAS;IAjBrB,OAAO,CAAC,MAAM,CAAC,CAAO;IACtB,OAAO,CAAC,OAAO,CAAC,CAAQ;IACxB,OAAO,CAAC,cAAc,CAAC,CAAO;IAE9B,OAAO,CAAC,MAAM,CAAI;IAClB,OAAO,CAAC,SAAS,CAAO;IACxB,OAAO,CAAC,SAAS,CAAkB;IACnC,OAAO,CAAC,SAAS,CAAiC;IAClD,OAAO,CAAC,QAAQ,CAAiC;IACjD,OAAO,CAAC,QAAQ,CAAiC;IACjD,OAAO,CAAC,eAAe,CAAqB;gBAGhC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,WAAW,EACpB,MAAM,EAAE,MAAM,EAAE,EAChB,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build/index.js CHANGED
@@ -136,9 +136,10 @@ class MochaAdapter {
136
136
  * For some reason, Mocha fires a second 'suite:end' event for the root suite,
137
137
  * with no matching 'suite:start', so this can be ignored.
138
138
  */
139
- if (payload.root)
139
+ if (payload.root) {
140
140
  return;
141
- let message = formatMessage({ type: event, payload, err });
141
+ }
142
+ const message = formatMessage({ type: event, payload, err });
142
143
  message.cid = this._cid;
143
144
  message.specs = this._specs;
144
145
  message.uid = this.getUID(message);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wdio/mocha-framework",
3
- "version": "8.0.13",
3
+ "version": "8.1.0",
4
4
  "description": "A WebdriverIO plugin. Adapter for Mocha testing framework.",
5
5
  "author": "Christian Bromann <mail@bromann.dev>",
6
6
  "homepage": "https://github.com/webdriverio/webdriverio/tree/main/packages/wdio-mocha-framework",
@@ -23,26 +23,29 @@
23
23
  },
24
24
  "type": "module",
25
25
  "exports": {
26
+ ".": {
27
+ "import": "./build/index.js",
28
+ "types": "./build/index.d.ts"
29
+ },
26
30
  "./common": {
27
31
  "import": "./build/common.js",
28
32
  "types": "./build/common.d.ts"
29
- },
30
- ".": "./build/index.js"
33
+ }
31
34
  },
32
35
  "types": "./build/index.d.ts",
33
36
  "typeScriptVersion": "3.8.3",
34
37
  "dependencies": {
35
- "@types/mocha": "^10.0.0",
36
- "@wdio/logger": "8.0.0",
37
- "@wdio/types": "8.0.11",
38
- "@wdio/utils": "8.0.13",
38
+ "@types/node": "^18.0.0",
39
+ "@wdio/logger": "8.1.0",
40
+ "@wdio/types": "8.1.0",
41
+ "@wdio/utils": "8.1.0",
39
42
  "mocha": "^10.0.0"
40
43
  },
41
44
  "devDependencies": {
42
- "@types/node": "^18.0.0"
45
+ "@types/mocha": "^10.0.0"
43
46
  },
44
47
  "publishConfig": {
45
48
  "access": "public"
46
49
  },
47
- "gitHead": "912db21d2cd4552a02b776ba74cae05440b076de"
50
+ "gitHead": "f505134606f99129c816acb00f22e39032e60820"
48
51
  }