expect-webdriverio 4.15.2 → 4.15.3
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/lib/utils.js +11 -1
- package/package.json +1 -1
package/lib/utils.js
CHANGED
|
@@ -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) =>
|
|
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) {
|