@wdio/globals 8.22.1 → 8.23.1

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":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AAEA,KAAK,gBAAgB,GAAG,SAAS,GAAG,QAAQ,GAAG,oBAAoB,GAAG,GAAG,GAAG,IAAI,GAAG,QAAQ,CAAA;AAE3F,OAAO,CAAC,MAAM,CAAC;IAEX,IAAI,YAAY,EAAE,GAAG,CAAC,gBAAgB,EAAE,GAAG,CAAC,CAAA;CAC/C;AA6BD,eAAO,MAAM,OAAO,EAAE,WAAW,CAAC,OAGjC,CAAA;AACD,eAAO,MAAM,MAAM,EAAE,WAAW,CAAC,OAGhC,CAAA;AACD,eAAO,MAAM,kBAAkB,EAAE,WAAW,CAAC,kBAG5C,CAAA;AACD,eAAO,MAAM,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,GAAG,CAKtC,CAAA;AACD,eAAO,MAAM,EAAE,EAAE,WAAW,CAAC,OAAO,CAAC,IAAI,CAKxC,CAAA;AACD,eAAO,MAAM,MAAM,EAAE,iBAAiB,CAAC,MAKT,CAAA;AAU9B;;;;;GAKG;AACH,wBAAgB,UAAU,CAAE,GAAG,EAAE,gBAAgB,EAAE,KAAK,EAAE,GAAG,EAAE,SAAS,UAAO,QAO9E"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AAEA,KAAK,gBAAgB,GAAG,SAAS,GAAG,QAAQ,GAAG,oBAAoB,GAAG,GAAG,GAAG,IAAI,GAAG,QAAQ,CAAA;AAE3F,OAAO,CAAC,MAAM,CAAC;IAEX,IAAI,YAAY,EAAE,GAAG,CAAC,gBAAgB,EAAE,GAAG,CAAC,CAAA;CAC/C;AA6BD,eAAO,MAAM,OAAO,EAAE,WAAW,CAAC,OAGjC,CAAA;AACD,eAAO,MAAM,MAAM,EAAE,WAAW,CAAC,OAGhC,CAAA;AACD,eAAO,MAAM,kBAAkB,EAAE,WAAW,CAAC,kBAG5C,CAAA;AACD,eAAO,MAAM,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,GAAG,CAKtC,CAAA;AACD,eAAO,MAAM,EAAE,EAAE,WAAW,CAAC,OAAO,CAAC,IAAI,CAKxC,CAAA;AACD,eAAO,MAAM,MAAM,EAAE,iBAAiB,CAAC,MAKT,CAAA;AAsC9B;;;;;GAKG;AACH,wBAAgB,UAAU,CAAE,GAAG,EAAE,gBAAgB,EAAE,KAAK,EAAE,GAAG,EAAE,SAAS,UAAO,QAO9E"}
package/build/index.js CHANGED
@@ -46,6 +46,31 @@ export const expect = ((...args) => {
46
46
  }
47
47
  return globals.get('expect')(...args);
48
48
  });
49
+ const ASYNC_MATCHERS = [
50
+ 'any',
51
+ 'anything',
52
+ 'arrayContaining',
53
+ 'objectContaining',
54
+ 'stringContaining',
55
+ 'stringMatching',
56
+ ];
57
+ for (const matcher of ASYNC_MATCHERS) {
58
+ expect[matcher] = (...args) => {
59
+ if (!globals.has('expect')) {
60
+ throw new Error(GLOBALS_ERROR_MESSAGE);
61
+ }
62
+ return globals.get('expect')[matcher](...args);
63
+ };
64
+ }
65
+ expect.not = ASYNC_MATCHERS.reduce((acc, matcher) => {
66
+ acc[matcher] = (...args) => {
67
+ if (!globals.has('expect')) {
68
+ throw new Error(GLOBALS_ERROR_MESSAGE);
69
+ }
70
+ return globals.get('expect').not[matcher](...args);
71
+ };
72
+ return acc;
73
+ }, {});
49
74
  expect.extend = (...args) => {
50
75
  if (!globals.has('expect')) {
51
76
  throw new Error(GLOBALS_ERROR_MESSAGE);
package/cjs/index.js CHANGED
@@ -51,6 +51,31 @@ exports.expect = ((...args) => {
51
51
  }
52
52
  return globals.get('expect')(...args);
53
53
  });
54
+ const ASYNC_MATCHERS = [
55
+ 'any',
56
+ 'anything',
57
+ 'arrayContaining',
58
+ 'objectContaining',
59
+ 'stringContaining',
60
+ 'stringMatching',
61
+ ];
62
+ for (const matcher of ASYNC_MATCHERS) {
63
+ exports.expect[matcher] = (...args) => {
64
+ if (!globals.has('expect')) {
65
+ throw new Error(GLOBALS_ERROR_MESSAGE);
66
+ }
67
+ return globals.get('expect')[matcher](...args);
68
+ };
69
+ }
70
+ exports.expect.not = ASYNC_MATCHERS.reduce((acc, matcher) => {
71
+ acc[matcher] = (...args) => {
72
+ if (!globals.has('expect')) {
73
+ throw new Error(GLOBALS_ERROR_MESSAGE);
74
+ }
75
+ return globals.get('expect').not[matcher](...args);
76
+ };
77
+ return acc;
78
+ }, {});
54
79
  exports.expect.extend = (...args) => {
55
80
  if (!globals.has('expect')) {
56
81
  throw new Error(GLOBALS_ERROR_MESSAGE);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wdio/globals",
3
- "version": "8.22.1",
3
+ "version": "8.23.1",
4
4
  "description": "A helper utility for importing global variables directly",
5
5
  "author": "Christian Bromann <mail@bromann.dev>",
6
6
  "homepage": "https://github.com/webdriverio/webdriverio/tree/main/packages/wdio-globals",
@@ -42,8 +42,8 @@
42
42
  "access": "public"
43
43
  },
44
44
  "optionalDependencies": {
45
- "expect-webdriverio": "^4.2.5",
46
- "webdriverio": "8.22.1"
45
+ "expect-webdriverio": "^4.5.1",
46
+ "webdriverio": "8.23.1"
47
47
  },
48
- "gitHead": "00a86c3267401a5d277d21b553ebfb6f04aeb3db"
48
+ "gitHead": "64633b802ba4d00d23f6531dadc3fc724d8d7dd5"
49
49
  }
package/types.d.ts CHANGED
@@ -1,12 +1,5 @@
1
1
  type ExpectType = import('expect-webdriverio').Expect
2
2
 
3
- declare namespace WebdriverIO {
4
- interface Browser extends BrowserType { }
5
- interface Element extends ElementType { }
6
- interface MultiRemoteBrowser extends MultiRemoteBrowserType { }
7
- interface MultiRemoteElement extends MultiRemoteElementType { }
8
- }
9
-
10
3
  declare module NodeJS {
11
4
  interface Global {
12
5
  multiremotebrowser: WebdriverIO.MultiRemoteBrowser