expect-webdriverio 4.4.1 → 4.5.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.
Files changed (2) hide show
  1. package/lib/utils.js +11 -0
  2. package/package.json +17 -17
package/lib/utils.js CHANGED
@@ -4,6 +4,9 @@ import { wrapExpectedWithArray, updateElementsArray } from './util/elementsUtil.
4
4
  import { enhanceError, enhanceErrorBe, numberError } from './util/formatMessage.js';
5
5
  import { DEFAULT_OPTIONS } from './constants.js';
6
6
  const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
7
+ const asymmetricMatcher = typeof Symbol === 'function' && Symbol.for
8
+ ? Symbol.for('jest.asymmetricMatcher')
9
+ : 1267621;
7
10
  const waitUntil = async (condition, isNot = false, { wait = DEFAULT_OPTIONS.wait, interval = DEFAULT_OPTIONS.interval } = {}) => {
8
11
  if (wait === 0) {
9
12
  return await condition();
@@ -75,6 +78,14 @@ export const compareText = (actual, expected, { ignoreCase = false, trim = true,
75
78
  result: false,
76
79
  };
77
80
  }
81
+ if (typeof expected === 'object' && '$$typeof' in expected && expected.$$typeof === asymmetricMatcher) {
82
+ const result = expected.asymmetricMatch(actual);
83
+ return {
84
+ value: actual,
85
+ result
86
+ };
87
+ }
88
+ expected = expected;
78
89
  if (trim) {
79
90
  actual = actual.trim();
80
91
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expect-webdriverio",
3
- "version": "4.4.1",
3
+ "version": "4.5.0",
4
4
  "author": "Mykola Grybyk <mykola.grybyk@gmail.com>",
5
5
  "description": "WebdriverIO Assertion Library",
6
6
  "license": "MIT",
@@ -58,30 +58,30 @@
58
58
  "prepare": "husky install"
59
59
  },
60
60
  "devDependencies": {
61
- "@types/debug": "^4.1.8",
62
- "@types/jest": "^29.5.4",
63
- "@types/lodash.isequal": "^4.5.6",
64
- "@types/node": "^20.6.0",
65
- "@typescript-eslint/eslint-plugin": "^6.7.0",
66
- "@typescript-eslint/parser": "^6.7.0",
67
- "@vitest/coverage-v8": "^0.34.4",
68
- "@wdio/globals": "^8.16.7",
61
+ "@types/debug": "^4.1.12",
62
+ "@types/jest": "^29.5.8",
63
+ "@types/lodash.isequal": "^4.5.8",
64
+ "@types/node": "^20.9.0",
65
+ "@typescript-eslint/eslint-plugin": "^6.10.0",
66
+ "@typescript-eslint/parser": "^6.10.0",
67
+ "@vitest/coverage-v8": "^0.34.6",
68
+ "@wdio/globals": "^8.22.1",
69
69
  "c8": "^8.0.1",
70
- "eslint": "^8.49.0",
71
- "eslint-plugin-import": "^2.28.1",
72
- "eslint-plugin-unicorn": "^48.0.1",
70
+ "eslint": "^8.53.0",
71
+ "eslint-plugin-import": "^2.29.0",
72
+ "eslint-plugin-unicorn": "^49.0.0",
73
73
  "husky": "^8.0.3",
74
74
  "npm-run-all": "^4.1.5",
75
- "release-it": "^16.1.5",
76
- "rimraf": "^5.0.1",
75
+ "release-it": "^16.2.1",
76
+ "rimraf": "^5.0.5",
77
77
  "shelljs": "^0.8.5",
78
78
  "typescript": "^5.2.2",
79
79
  "vitest": "0.34.6",
80
- "webdriverio": "^8.16.7"
80
+ "webdriverio": "8.22.1"
81
81
  },
82
82
  "optionalDependencies": {
83
- "@wdio/globals": "^8.16.7",
84
- "webdriverio": "^8.16.7"
83
+ "@wdio/globals": "^8.22.1",
84
+ "webdriverio": "^8.22.1"
85
85
  },
86
86
  "dependencies": {
87
87
  "expect": "^29.7.0",