expect-webdriverio 7.0.0 → 8.0.0-alpha.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/README.md +7 -3
- package/jasmine-wdio-expect-async.d.ts +1 -1
- package/lib/constants.js +0 -6
- package/lib/index.js +1 -13
- package/lib/jasmineUtils.js +2 -2
- package/lib/matchers/asymmetrics/oneOf.js +2 -2
- package/lib/matchers/browser/toHaveClipboardText.js +7 -3
- package/lib/matchers/browser/toHaveLocalStorageItem.js +1 -11
- package/lib/matchers/element/toBeClickable.js +3 -2
- package/lib/matchers/element/toBeDisabled.js +3 -2
- package/lib/matchers/element/toBeDisplayed.js +3 -2
- package/lib/matchers/element/toBeDisplayedInViewport.js +3 -2
- package/lib/matchers/element/toBeEnabled.js +3 -2
- package/lib/matchers/element/toBeExisting.js +5 -2
- package/lib/matchers/element/toBeFocused.js +3 -2
- package/lib/matchers/element/toBeSelected.js +4 -4
- package/lib/matchers/element/toHaveAttribute.js +2 -14
- package/lib/matchers/element/toHaveChildren.js +7 -13
- package/lib/matchers/element/toHaveComputedLabel.js +0 -2
- package/lib/matchers/element/toHaveComputedRole.js +0 -2
- package/lib/matchers/element/toHaveElementClass.js +3 -8
- package/lib/matchers/element/toHaveElementProperty.js +0 -5
- package/lib/matchers/element/toHaveHTML.js +3 -5
- package/lib/matchers/element/toHaveHeight.js +4 -5
- package/lib/matchers/element/toHaveHref.js +6 -3
- package/lib/matchers/element/toHaveId.js +3 -2
- package/lib/matchers/element/toHaveSize.js +0 -1
- package/lib/matchers/element/toHaveStyle.js +0 -1
- package/lib/matchers/element/toHaveText.js +2 -5
- package/lib/matchers/element/toHaveValue.js +1 -1
- package/lib/matchers/element/toHaveWidth.js +4 -5
- package/lib/matchers/elements/toBeElementsArrayOfSize.js +9 -11
- package/lib/matchers/mock/toBeRequested.js +1 -1
- package/lib/matchers/mock/toBeRequestedTimes.js +6 -6
- package/lib/matchers/mock/toBeRequestedWith.js +0 -3
- package/lib/matchers.js +32 -32
- package/lib/snapshot.js +1 -8
- package/lib/tsconfig.build.tsbuildinfo +1 -1
- package/lib/util/elementsUtil.js +3 -2
- package/lib/util/executeBrowserCommand.js +2 -2
- package/lib/util/executeCommand.js +2 -41
- package/lib/util/formatMessage.js +4 -4
- package/lib/util/multiRemoteUtils.js +9 -1
- package/lib/util/numberOptionsUtil.js +15 -26
- package/lib/utils.js +10 -110
- package/package.json +36 -39
- package/types/expect-global.d.ts +1 -2
- package/types/expect-webdriverio.d.ts +31 -222
|
@@ -73,12 +73,20 @@ export const getMockInstanceNames = (mocks) => {
|
|
|
73
73
|
};
|
|
74
74
|
export const isGlobalBrowserSingleRemote = () => {
|
|
75
75
|
try {
|
|
76
|
-
return typeof browser !== 'undefined' && isBrowser(browser) && !browser
|
|
76
|
+
return typeof browser !== 'undefined' && isBrowser(browser) && !hasMultiRemoteFlag(browser);
|
|
77
77
|
}
|
|
78
78
|
catch {
|
|
79
79
|
return false;
|
|
80
80
|
}
|
|
81
81
|
};
|
|
82
|
+
export const hasMultiRemoteFlag = (obj) => {
|
|
83
|
+
if (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) {
|
|
84
|
+
return false;
|
|
85
|
+
}
|
|
86
|
+
const { isMultiRemote, isMultiremote } = obj;
|
|
87
|
+
return isMultiRemote === true || isMultiremote === true;
|
|
88
|
+
};
|
|
89
|
+
export const isMultiRemoteBrowser = (browser) => hasMultiRemoteFlag(browser);
|
|
82
90
|
export const isBrowser = (obj) => {
|
|
83
91
|
const name = obj?.constructor?.name?.replace(/^bound /, '');
|
|
84
92
|
return name === 'Browser' || !!name?.endsWith('MultiRemoteDriver');
|
|
@@ -1,41 +1,37 @@
|
|
|
1
1
|
import { AsymmetricMatcher } from 'expect';
|
|
2
|
-
import { isDefinedPlainObject } from './commandOptionsUtils.js';
|
|
3
2
|
import { isMultiRemoteMatcher } from './multiRemoteUtils.js';
|
|
4
3
|
export const isNumber = (value) => typeof value === 'number' && !isNaN(value);
|
|
5
4
|
export const isDefinedNotNumber = (value) => value !== undefined && !isNumber(value);
|
|
6
5
|
export const isDefinedNumberOrNonEmptyObject = (value) => typeof value === 'number' || (typeof value === 'object' && value !== null && !Array.isArray(value) && Object.keys(value).length > 0);
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
if (supportDefaultAsGteThen1 &&
|
|
10
|
-
|
|
6
|
+
const NUMBER_MATCHER_KEYS = ['eq', 'gte', 'lte'];
|
|
7
|
+
export function validateNumberMatcher(expectedValue, { supportDefaultAsGteThen1 } = {}) {
|
|
8
|
+
if (supportDefaultAsGteThen1 && expectedValue === undefined) {
|
|
9
|
+
return new NumberMatcher({ gte: 1 });
|
|
11
10
|
}
|
|
12
|
-
|
|
13
|
-
return
|
|
11
|
+
if (isNumber(expectedValue)) {
|
|
12
|
+
return new NumberMatcher({ eq: expectedValue });
|
|
14
13
|
}
|
|
15
|
-
|
|
14
|
+
if (!isDefinedNumberOrNonEmptyObject(expectedValue)
|
|
15
|
+
|| Object.keys(expectedValue).some((key) => !NUMBER_MATCHER_KEYS.includes(key))
|
|
16
|
+
|| isDefinedNotNumber(expectedValue.eq) || isDefinedNotNumber(expectedValue.gte) || isDefinedNotNumber(expectedValue.lte)
|
|
16
17
|
|| (expectedValue.eq === undefined && expectedValue.gte === undefined && expectedValue.lte === undefined)) {
|
|
17
18
|
throw new Error(`Invalid NumberMatcher. Received: ${JSON.stringify(expectedValue)}`);
|
|
18
19
|
}
|
|
19
|
-
const { eq, gte, lte
|
|
20
|
+
const { eq, gte, lte } = expectedValue;
|
|
20
21
|
if (isNumber(gte) && isNumber(lte) && gte > lte) {
|
|
21
22
|
throw new Error(`Invalid NumberMatcher range: 'gte' (${gte}) cannot be greater than 'lte' (${lte}).`);
|
|
22
23
|
}
|
|
23
|
-
return {
|
|
24
|
-
numberMatcher: defaultExpectedValue ?? new NumberMatcher({ eq, gte, lte }),
|
|
25
|
-
commandOptions: { ...commandOptions, ...restCommandOptions }
|
|
26
|
-
};
|
|
24
|
+
return new NumberMatcher({ eq, gte, lte });
|
|
27
25
|
}
|
|
28
|
-
export function
|
|
26
|
+
export function validateNumberMatcherArray(expectedValues, { supportDefaultAsGteThen1 } = {}) {
|
|
29
27
|
if (isMultiRemoteMatcher(expectedValues)) {
|
|
30
28
|
const perInstanceValues = expectedValues.sample;
|
|
31
|
-
|
|
32
|
-
return { numberMatcher, commandOptions };
|
|
29
|
+
return Object.fromEntries(Object.entries(perInstanceValues).map(([instance, value]) => [instance, validateNumberMatcherArray(value)]));
|
|
33
30
|
}
|
|
34
31
|
if (Array.isArray(expectedValues)) {
|
|
35
|
-
|
|
36
|
-
return { numberMatcher: allNumbers.map(({ numberMatcher }) => numberMatcher), commandOptions };
|
|
32
|
+
return expectedValues.map((value) => validateNumberMatcher(value, { supportDefaultAsGteThen1 }));
|
|
37
33
|
}
|
|
38
|
-
return
|
|
34
|
+
return validateNumberMatcher(expectedValues, { supportDefaultAsGteThen1 });
|
|
39
35
|
}
|
|
40
36
|
export class NumberMatcher extends AsymmetricMatcher {
|
|
41
37
|
sample;
|
|
@@ -89,10 +85,3 @@ export class NumberMatcher extends AsymmetricMatcher {
|
|
|
89
85
|
return this.toString();
|
|
90
86
|
}
|
|
91
87
|
}
|
|
92
|
-
export const isEmptyOrLegacyNumberOptions = (value) => {
|
|
93
|
-
if (!isDefinedPlainObject(value)) {
|
|
94
|
-
return false;
|
|
95
|
-
}
|
|
96
|
-
const keys = Object.keys(value);
|
|
97
|
-
return keys.length === 0 || keys.filter((key) => !['eq', 'gte', 'lte'].includes(key)).length > 0;
|
|
98
|
-
};
|
package/lib/utils.js
CHANGED
|
@@ -4,8 +4,7 @@ import { wrapExpectedWithArray } from './util/elementsUtil.js';
|
|
|
4
4
|
import { executeCommandWithStrategy } from './util/executeCommand.js';
|
|
5
5
|
import { enhanceError, enhanceErrorBe } from './util/formatMessage.js';
|
|
6
6
|
import { waitUntil } from './util/waitUntil.js';
|
|
7
|
-
import {
|
|
8
|
-
import { isOneOfMatcher, OneOfMatcher } from './matchers/asymmetrics/oneOf.js';
|
|
7
|
+
import { isOneOfMatcher } from './matchers/asymmetrics/oneOf.js';
|
|
9
8
|
export function isJasmineStringAsymmetricMatcher(expected) {
|
|
10
9
|
return isAsymmetricMatcher(expected) && !('toAsymmetricMatcher' in expected) && 'jasmineToString' in expected && typeof expected.jasmineToString === 'function';
|
|
11
10
|
}
|
|
@@ -68,8 +67,8 @@ export function getAsymmetricMatcherValue(expected) {
|
|
|
68
67
|
return undefined;
|
|
69
68
|
}
|
|
70
69
|
async function executeCommandBe(received, command, options = {}) {
|
|
71
|
-
const { isNot, verb = 'be', allowEmptyElements = false } = this;
|
|
72
|
-
const { success: pass, actual, subject, context: { isSome } = {} } = await waitUntil(async (iteration) => {
|
|
70
|
+
const { isNot, verb = 'be', expectation = '', allowEmptyElements = false } = this;
|
|
71
|
+
const { success: pass, actual, subject, context: { isSome = false } = {} } = await waitUntil(async (iteration) => {
|
|
73
72
|
return await executeCommandWithStrategy({
|
|
74
73
|
unresolvedElements: received,
|
|
75
74
|
expectedValues: true,
|
|
@@ -81,44 +80,20 @@ async function executeCommandBe(received, command, options = {}) {
|
|
|
81
80
|
strictConfiguration: { allowEmptyElements },
|
|
82
81
|
});
|
|
83
82
|
}, isNot, { wait: options.wait, interval: options.interval });
|
|
84
|
-
const message = enhanceErrorBe(subject, actual, { ...this, verb, isSome }, options);
|
|
83
|
+
const message = enhanceErrorBe(subject, actual, { ...this, verb, expectation, isSome }, options);
|
|
85
84
|
return {
|
|
86
85
|
pass,
|
|
87
86
|
message: () => message,
|
|
88
87
|
};
|
|
89
88
|
}
|
|
90
|
-
const
|
|
91
|
-
if (
|
|
92
|
-
return actual === options.eq;
|
|
93
|
-
}
|
|
94
|
-
if (typeof options.gte === 'number' && typeof options.lte === 'number') {
|
|
95
|
-
return actual >= options.gte && actual <= options.lte;
|
|
96
|
-
}
|
|
97
|
-
if (typeof options.gte === 'number') {
|
|
98
|
-
return actual >= options.gte;
|
|
99
|
-
}
|
|
100
|
-
if (typeof options.lte === 'number') {
|
|
101
|
-
return actual <= options.lte;
|
|
102
|
-
}
|
|
103
|
-
return false;
|
|
104
|
-
};
|
|
105
|
-
export const compareTextOrOneOf = (actualText, expectedTexts, options) => {
|
|
106
|
-
if (expectedTexts === undefined) {
|
|
89
|
+
export const compareTextOrOneOf = (actualText, expectedText, options) => {
|
|
90
|
+
if (expectedText === undefined || Array.isArray(expectedText)) {
|
|
107
91
|
return { actual: actualText, success: false };
|
|
108
92
|
}
|
|
109
|
-
if (
|
|
110
|
-
|
|
111
|
-
throw new Error('OneOf is not supported in array under legacy behavior. Please enable `useToHaveTextStrictMultiElementsCompareStrategy` feature flag to use the new strict index based matching strategy with `expect.oneOf()`.');
|
|
112
|
-
}
|
|
113
|
-
else {
|
|
114
|
-
console.warn('Array of expected values is deprecated. Please use `expect.oneOf()` asymmetric matcher to compare against multiple expected values. This will be removed in v8.0.0.');
|
|
115
|
-
expectedTexts = new OneOfMatcher(...expectedTexts).withOptions(options);
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
if (isOneOfMatcher(expectedTexts)) {
|
|
119
|
-
return { success: expectedTexts.asymmetricMatch(actualText), actual: actualText };
|
|
93
|
+
if (isOneOfMatcher(expectedText)) {
|
|
94
|
+
return { success: expectedText.asymmetricMatch(actualText), actual: actualText };
|
|
120
95
|
}
|
|
121
|
-
const compareResults = compareText(actualText,
|
|
96
|
+
const compareResults = compareText(actualText, expectedText, options);
|
|
122
97
|
return { ...compareResults, actual: actualText };
|
|
123
98
|
};
|
|
124
99
|
export const compareText = (actual, expected, { ignoreCase = false, trim = true, containing = false, atStart = false, atEnd = false, atIndex, replace, }) => {
|
|
@@ -202,74 +177,6 @@ export const compareText = (actual, expected, { ignoreCase = false, trim = true,
|
|
|
202
177
|
success: actual === expected,
|
|
203
178
|
};
|
|
204
179
|
};
|
|
205
|
-
export const compareTextWithArray = (actual, expectedArray, { ignoreCase = false, trim = false, containing = false, atStart = false, atEnd = false, atIndex, replace, }) => {
|
|
206
|
-
if (typeof actual !== 'string') {
|
|
207
|
-
return {
|
|
208
|
-
actual,
|
|
209
|
-
success: false,
|
|
210
|
-
};
|
|
211
|
-
}
|
|
212
|
-
if (trim) {
|
|
213
|
-
actual = actual.trim();
|
|
214
|
-
}
|
|
215
|
-
if (Array.isArray(replace)) {
|
|
216
|
-
actual = replaceActual(replace, actual);
|
|
217
|
-
}
|
|
218
|
-
const actualOriginalCase = actual;
|
|
219
|
-
if (ignoreCase) {
|
|
220
|
-
actual = actual.toLowerCase();
|
|
221
|
-
expectedArray = expectedArray.map((item) => {
|
|
222
|
-
if (typeof item === 'string') {
|
|
223
|
-
return item.toLowerCase();
|
|
224
|
-
}
|
|
225
|
-
if (item instanceof RegExp) {
|
|
226
|
-
return withIgnoreCaseFlag(item);
|
|
227
|
-
}
|
|
228
|
-
if (isStringContainingMatcherLike(item)) {
|
|
229
|
-
const sample = getStringAsymmetricMatcherValue(item).toString().toLocaleLowerCase();
|
|
230
|
-
return (isInversedStringContainingMatcher(item)
|
|
231
|
-
? expect.not.stringContaining(sample)
|
|
232
|
-
: expect.stringContaining(sample));
|
|
233
|
-
}
|
|
234
|
-
if (isStringMatchingMatcherLike(item)) {
|
|
235
|
-
const sample = getStringAsymmetricMatcherValue(item);
|
|
236
|
-
const caseInsensitiveSample = withIgnoreCaseFlag(sample instanceof RegExp ? sample : new RegExp(sample));
|
|
237
|
-
return (isInversedStringMatchingMatcher(item)
|
|
238
|
-
? expect.not.stringMatching(caseInsensitiveSample)
|
|
239
|
-
: expect.stringMatching(caseInsensitiveSample));
|
|
240
|
-
}
|
|
241
|
-
return item;
|
|
242
|
-
});
|
|
243
|
-
}
|
|
244
|
-
const hasFoundTextInArray = expectedArray.some((expected) => {
|
|
245
|
-
if (expected instanceof RegExp) {
|
|
246
|
-
return !!actualOriginalCase.match(expected);
|
|
247
|
-
}
|
|
248
|
-
if (isStringMatchingMatcherLike(expected) && getStringAsymmetricMatcherValue(expected) instanceof RegExp) {
|
|
249
|
-
return expected.asymmetricMatch(actualOriginalCase);
|
|
250
|
-
}
|
|
251
|
-
if (isAsymmetricMatcher(expected)) {
|
|
252
|
-
return expected.asymmetricMatch(actual);
|
|
253
|
-
}
|
|
254
|
-
if (containing) {
|
|
255
|
-
return actual.includes(expected);
|
|
256
|
-
}
|
|
257
|
-
if (atStart) {
|
|
258
|
-
return actual.startsWith(expected);
|
|
259
|
-
}
|
|
260
|
-
if (atEnd) {
|
|
261
|
-
return actual.endsWith(expected);
|
|
262
|
-
}
|
|
263
|
-
if (atIndex !== undefined) {
|
|
264
|
-
return actual.substring(atIndex, actual.length).startsWith(expected);
|
|
265
|
-
}
|
|
266
|
-
return actual === expected;
|
|
267
|
-
});
|
|
268
|
-
return {
|
|
269
|
-
actual: actualOriginalCase,
|
|
270
|
-
success: hasFoundTextInArray,
|
|
271
|
-
};
|
|
272
|
-
};
|
|
273
180
|
export const compareObject = (actual, expected) => {
|
|
274
181
|
if (typeof actual !== 'object' || Array.isArray(actual)) {
|
|
275
182
|
return {
|
|
@@ -335,7 +242,7 @@ export const compareStyle = async (actualEl, style, { ignoreCase = false, trim =
|
|
|
335
242
|
success,
|
|
336
243
|
};
|
|
337
244
|
};
|
|
338
|
-
export {
|
|
245
|
+
export { enhanceError, executeCommandBe, waitUntil, wrapExpectedWithArray };
|
|
339
246
|
function withIgnoreCaseFlag(expected) {
|
|
340
247
|
const cloned = expected.ignoreCase
|
|
341
248
|
? new RegExp(expected.source, expected.flags)
|
|
@@ -357,11 +264,4 @@ function replaceActual(replace, actual) {
|
|
|
357
264
|
}
|
|
358
265
|
return actual;
|
|
359
266
|
}
|
|
360
|
-
export const getFeatureFlagValue = ({ featureFlags }, featureFlag) => {
|
|
361
|
-
const providedFeatureFlagValue = featureFlags?.[featureFlag];
|
|
362
|
-
if (providedFeatureFlagValue !== undefined) {
|
|
363
|
-
return providedFeatureFlagValue;
|
|
364
|
-
}
|
|
365
|
-
return DEFAULT_FEATURE_FLAGS[featureFlag] ?? false;
|
|
366
|
-
};
|
|
367
267
|
export const toArray = (value) => value === undefined ? [] : Array.isArray(value) ? value : [value];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expect-webdriverio",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.0.0-alpha.0",
|
|
4
4
|
"author": "Mykola Grybyk <mykola.grybyk@gmail.com>",
|
|
5
5
|
"description": "WebdriverIO Assertion Library",
|
|
6
6
|
"license": "MIT",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"wdio"
|
|
20
20
|
],
|
|
21
21
|
"type": "module",
|
|
22
|
-
"
|
|
22
|
+
"main": "./lib/index.js",
|
|
23
23
|
"exports": {
|
|
24
24
|
".": [
|
|
25
25
|
{
|
|
@@ -43,7 +43,6 @@
|
|
|
43
43
|
"types": "./jasmine-wdio-expect-async.d.ts"
|
|
44
44
|
}
|
|
45
45
|
],
|
|
46
|
-
"./types": "./types/expect-global.d.ts",
|
|
47
46
|
"./expect-global": "./types/expect-global.d.ts",
|
|
48
47
|
"./api": [
|
|
49
48
|
{
|
|
@@ -56,8 +55,9 @@
|
|
|
56
55
|
"types": "./types/expect-webdriverio.d.ts",
|
|
57
56
|
"typeScriptVersion": "3.8.3",
|
|
58
57
|
"engines": {
|
|
59
|
-
"node": ">=
|
|
58
|
+
"node": ">=22.19.0"
|
|
60
59
|
},
|
|
60
|
+
"packageManager": "pnpm@11.27.1+sha512.a81d4c21b9b09a4b0aebf90ef5e527d4262bdda322d26082978cb549023ac6d9cafc98b19fffaa5c71db438a65f70224edb78d7311187861ff96480d1cdca23c",
|
|
61
61
|
"scripts": {
|
|
62
62
|
"build": "run-s clean compile",
|
|
63
63
|
"clean": "run-p clean:*",
|
|
@@ -65,66 +65,63 @@
|
|
|
65
65
|
"compile": "run-s compile:*",
|
|
66
66
|
"compile:lib": "tsc --build tsconfig.build.json",
|
|
67
67
|
"compile:check": "if [ ! -f lib/index.js ] || [ $(find lib -type f | wc -l) -le 30 ]; then echo 'File structure under lib is broken'; exit 1; fi",
|
|
68
|
-
"tsc:root-types": "node types-checks-filter-out-node_modules.js",
|
|
69
68
|
"test": "run-s test:*",
|
|
70
69
|
"test:tsc": "tsc --project tsconfig.json --noEmit --rootDir .",
|
|
71
|
-
"test:lint": "
|
|
70
|
+
"test:lint": "oxlint",
|
|
72
71
|
"test:unit": "vitest --run",
|
|
73
|
-
"test:types": "
|
|
72
|
+
"test:types": "pnpm run ts",
|
|
74
73
|
"ts": "run-s ts:* ts:*:*",
|
|
75
|
-
"ts:jasmine": "cd test-types/jasmine && vitest --typecheck --typecheck.tsconfig ./tsconfig.json --run",
|
|
76
|
-
"ts:jasmine-global-expect-async": "cd test-types/jasmine-global-expect-async && vitest --typecheck --typecheck.tsconfig ./tsconfig.json --run",
|
|
77
|
-
"ts:jest:@types-jest": "cd test-types/jest-@types_jest && vitest --typecheck --typecheck.tsconfig ./tsconfig.json --run",
|
|
78
|
-
"ts:mocha": "cd test-types/mocha && vitest --typecheck --typecheck.tsconfig ./tsconfig.json --run",
|
|
79
|
-
"ts:arethetypeswrong": "
|
|
80
|
-
"
|
|
81
|
-
"
|
|
74
|
+
"ts:jasmine": "cd test-types/jasmine && vitest --typecheck --coverage.enabled=false --typecheck.tsconfig ./tsconfig.json --run",
|
|
75
|
+
"ts:jasmine-global-expect-async": "cd test-types/jasmine-global-expect-async && vitest --typecheck --coverage.enabled=false --typecheck.tsconfig ./tsconfig.json --run",
|
|
76
|
+
"ts:jest:@types-jest": "cd test-types/jest-@types_jest && vitest --typecheck --coverage.enabled=false --typecheck.tsconfig ./tsconfig.json --run",
|
|
77
|
+
"ts:mocha": "cd test-types/mocha && vitest --typecheck --coverage.enabled=false --typecheck.tsconfig ./tsconfig.json --run",
|
|
78
|
+
"ts:arethetypeswrong": "attw --pack . --profile esm-only",
|
|
79
|
+
"ts:declarations": "node types-checks-declarations.js",
|
|
80
|
+
"ts:package": "node types-checks-package.js",
|
|
81
|
+
"checks:all": "pnpm run build && pnpm test",
|
|
82
|
+
"watch": "pnpm run compile --watch",
|
|
82
83
|
"prepare": "husky",
|
|
83
84
|
"playgrounds:clean": "rimraf --glob '**/node_modules'",
|
|
84
|
-
"playgrounds:setup": "
|
|
85
|
-
"playgrounds:checks:all": "cd playgrounds &&
|
|
86
|
-
"playgrounds:snapshots:update": "cd playgrounds &&
|
|
85
|
+
"playgrounds:setup": "pnpm run playgrounds:clean; pnpm install && cd playgrounds && pnpm run setup",
|
|
86
|
+
"playgrounds:checks:all": "cd playgrounds && pnpm run checks:all",
|
|
87
|
+
"playgrounds:snapshots:update": "cd playgrounds && pnpm run snapshots:update"
|
|
87
88
|
},
|
|
88
89
|
"dependencies": {
|
|
89
|
-
"@vitest/snapshot": "^
|
|
90
|
+
"@vitest/snapshot": "^5.0.2",
|
|
91
|
+
"@wdio/types": "^9.31.5",
|
|
90
92
|
"deep-eql": "^5.0.2",
|
|
91
|
-
"expect": "^30.
|
|
92
|
-
"jest-matcher-utils": "^30.
|
|
93
|
+
"expect": "^30.5.2",
|
|
94
|
+
"jest-matcher-utils": "^30.5.2"
|
|
93
95
|
},
|
|
94
96
|
"devDependencies": {
|
|
95
97
|
"@arethetypeswrong/cli": "^0.18.5",
|
|
96
|
-
"@jest/globals": "^30.
|
|
98
|
+
"@jest/globals": "^30.5.2",
|
|
99
|
+
"@stylistic/eslint-plugin": "^5.10.0",
|
|
97
100
|
"@types/debug": "^4.1.13",
|
|
98
|
-
"@types/
|
|
101
|
+
"@types/deep-eql": "^4.0.2",
|
|
102
|
+
"@types/jasmine": "^6.0.0",
|
|
99
103
|
"@types/jest": "^30.0.0",
|
|
100
104
|
"@types/mocha": "^10.0.10",
|
|
101
|
-
"@types/node": "^24.
|
|
102
|
-
"@vitest/coverage-v8": "^
|
|
103
|
-
"@
|
|
104
|
-
"@wdio/
|
|
105
|
-
"@wdio/
|
|
106
|
-
"eslint": "^9.39.5",
|
|
105
|
+
"@types/node": "^24.19.0",
|
|
106
|
+
"@vitest/coverage-v8": "^5.0.2",
|
|
107
|
+
"@wdio/cli": "^9.32.0",
|
|
108
|
+
"@wdio/globals": "^9.31.3",
|
|
109
|
+
"@wdio/protocols": "^9.31.5",
|
|
107
110
|
"husky": "^9.1.7",
|
|
108
111
|
"npm-run-all2": "^9.0.3",
|
|
109
|
-
"
|
|
112
|
+
"oxlint": "^1.85.0",
|
|
113
|
+
"release-it": "^21.1.0",
|
|
110
114
|
"rimraf": "^6.1.3",
|
|
111
115
|
"strip-ansi": "^7.2.0",
|
|
112
|
-
"typescript": "^
|
|
113
|
-
"vitest": "^
|
|
116
|
+
"typescript": "^7.0.2",
|
|
117
|
+
"vitest": "^5.0.2",
|
|
118
|
+
"webdriver": "^9.32.0",
|
|
114
119
|
"webdriverio": "^9.32.0"
|
|
115
120
|
},
|
|
116
121
|
"peerDependencies": {
|
|
117
|
-
"@wdio/globals": "^9.23.0",
|
|
118
|
-
"@wdio/logger": "^9.0.0",
|
|
119
122
|
"webdriverio": "^9.31.5"
|
|
120
123
|
},
|
|
121
124
|
"peerDependenciesMeta": {
|
|
122
|
-
"@wdio/globals": {
|
|
123
|
-
"optional": false
|
|
124
|
-
},
|
|
125
|
-
"@wdio/logger": {
|
|
126
|
-
"optional": false
|
|
127
|
-
},
|
|
128
125
|
"webdriverio": {
|
|
129
126
|
"optional": false
|
|
130
127
|
}
|
package/types/expect-global.d.ts
CHANGED
|
@@ -5,12 +5,11 @@
|
|
|
5
5
|
* Required when used in standalone mode (mocha) or to override the one of Jasmine
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
// @ts-expect-error:
|
|
8
|
+
// @ts-ignore, not @ts-expect-error: only a conflict when the Jasmine `expect` is also loaded
|
|
9
9
|
declare const expect: ExpectWebdriverIO.Expect
|
|
10
10
|
|
|
11
11
|
declare namespace NodeJS {
|
|
12
12
|
interface Global {
|
|
13
|
-
// @ts-expect-error: Both wdio & Jasmine augmentation declare different global expect explaining why TS is complaining here
|
|
14
13
|
expect: ExpectWebdriverIO.Expect
|
|
15
14
|
}
|
|
16
15
|
}
|