expect-webdriverio 4.15.2 → 4.15.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.
Files changed (2) hide show
  1. package/lib/utils.js +12 -2
  2. package/package.json +1 -1
package/lib/utils.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import isEqual from 'lodash.isequal';
2
- import expect from 'expect';
2
+ import { expect } from './index.js';
3
3
  import { DEFAULT_OPTIONS } from './constants.js';
4
4
  import { wrapExpectedWithArray } from './util/elementsUtil.js';
5
5
  import { executeCommand } from './util/executeCommand.js';
@@ -163,7 +163,17 @@ export const compareTextWithArray = (actual, expectedArray, { ignoreCase = false
163
163
  }
164
164
  if (ignoreCase) {
165
165
  actual = actual.toLowerCase();
166
- expectedArray = expectedArray.map((item) => (typeof item !== 'string' ? item : item.toLowerCase()));
166
+ expectedArray = expectedArray.map((item) => {
167
+ if (typeof item === 'string') {
168
+ return item.toLowerCase();
169
+ }
170
+ if (isStringContainingMatcher(item)) {
171
+ return (item.toString() === 'StringContaining'
172
+ ? expect.stringContaining(item.sample?.toString().toLowerCase())
173
+ : expect.not.stringContaining(item.sample?.toString().toLowerCase()));
174
+ }
175
+ return item;
176
+ });
167
177
  }
168
178
  const textInArray = expectedArray.some((expected) => {
169
179
  if (expected instanceof RegExp) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expect-webdriverio",
3
- "version": "4.15.2",
3
+ "version": "4.15.4",
4
4
  "author": "Mykola Grybyk <mykola.grybyk@gmail.com>",
5
5
  "description": "WebdriverIO Assertion Library",
6
6
  "license": "MIT",