expect-webdriverio 6.0.2 → 6.0.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.
@@ -0,0 +1,2 @@
1
+ import { some as wdioSome } from '../matchers/modifiers/some.js';
2
+ export const some = wdioSome;
package/lib/index.js CHANGED
@@ -4,7 +4,6 @@ import { DEFAULT_OPTIONS, defaultOptionsList } from './constants.js';
4
4
  import createSoftExpect from './softExpect.js';
5
5
  import { SoftAssertService } from './softAssert.js';
6
6
  import { oneOf } from './matchers/asymmetrics/oneOf.js';
7
- import { some as wdioSome } from './matchers/modifiers/some.js';
8
7
  export const wdioCustomMatchers = {};
9
8
  export const matchers = new Map();
10
9
  const extend = expectLib.extend;
@@ -40,7 +39,6 @@ Object.defineProperty(wdioExpect, 'clearSoftFailures', {
40
39
  value: (testId) => SoftAssertService.getInstance().clearFailures(testId)
41
40
  });
42
41
  export const expect = wdioExpect;
43
- export const some = wdioSome;
44
42
  export const getDefaultOptions = () => DEFAULT_OPTIONS;
45
43
  export const setDefaultOptions = (options) => {
46
44
  Object.entries(options).forEach(([key, value]) => {
@@ -1 +1 @@
1
- {"root":["../src/constants.ts","../src/index.ts","../src/jasmineUtils.ts","../src/matchers.ts","../src/snapshot.ts","../src/softAssert.ts","../src/softAssertService.ts","../src/softExpect.ts","../src/types.ts","../src/utils.ts","../src/matchers/snapshot.ts","../src/matchers/asymmetrics/asymmetricsUtils.ts","../src/matchers/asymmetrics/oneOf.ts","../src/matchers/browser/toHaveClipboardText.ts","../src/matchers/browser/toHaveLocalStorageItem.ts","../src/matchers/browser/toHaveTitle.ts","../src/matchers/browser/toHaveUrl.ts","../src/matchers/element/toBeClickable.ts","../src/matchers/element/toBeDisabled.ts","../src/matchers/element/toBeDisplayed.ts","../src/matchers/element/toBeDisplayedInViewport.ts","../src/matchers/element/toBeEnabled.ts","../src/matchers/element/toBeExisting.ts","../src/matchers/element/toBeFocused.ts","../src/matchers/element/toBeSelected.ts","../src/matchers/element/toHaveAttribute.ts","../src/matchers/element/toHaveChildren.ts","../src/matchers/element/toHaveComputedLabel.ts","../src/matchers/element/toHaveComputedRole.ts","../src/matchers/element/toHaveElementClass.ts","../src/matchers/element/toHaveElementProperty.ts","../src/matchers/element/toHaveHTML.ts","../src/matchers/element/toHaveHeight.ts","../src/matchers/element/toHaveHref.ts","../src/matchers/element/toHaveId.ts","../src/matchers/element/toHaveSize.ts","../src/matchers/element/toHaveStyle.ts","../src/matchers/element/toHaveText.ts","../src/matchers/element/toHaveValue.ts","../src/matchers/element/toHaveWidth.ts","../src/matchers/elements/toBeElementsArrayOfSize.ts","../src/matchers/mock/toBeRequested.ts","../src/matchers/mock/toBeRequestedTimes.ts","../src/matchers/mock/toBeRequestedWith.ts","../src/matchers/modifiers/some.ts","../src/util/commandOptionsUtils.ts","../src/util/elementsUtil.ts","../src/util/executeCommand.ts","../src/util/formatMessage.ts","../src/util/numberOptionsUtil.ts","../src/util/refetchElements.ts","../src/util/stringUtil.ts","../src/util/waitUntil.ts"],"version":"5.9.3"}
1
+ {"root":["../src/constants.ts","../src/index.ts","../src/jasmineUtils.ts","../src/matchers.ts","../src/snapshot.ts","../src/softAssert.ts","../src/softAssertService.ts","../src/softExpect.ts","../src/types.ts","../src/utils.ts","../src/api/index.ts","../src/matchers/snapshot.ts","../src/matchers/asymmetrics/asymmetricsUtils.ts","../src/matchers/asymmetrics/oneOf.ts","../src/matchers/browser/toHaveClipboardText.ts","../src/matchers/browser/toHaveLocalStorageItem.ts","../src/matchers/browser/toHaveTitle.ts","../src/matchers/browser/toHaveUrl.ts","../src/matchers/element/toBeClickable.ts","../src/matchers/element/toBeDisabled.ts","../src/matchers/element/toBeDisplayed.ts","../src/matchers/element/toBeDisplayedInViewport.ts","../src/matchers/element/toBeEnabled.ts","../src/matchers/element/toBeExisting.ts","../src/matchers/element/toBeFocused.ts","../src/matchers/element/toBeSelected.ts","../src/matchers/element/toHaveAttribute.ts","../src/matchers/element/toHaveChildren.ts","../src/matchers/element/toHaveComputedLabel.ts","../src/matchers/element/toHaveComputedRole.ts","../src/matchers/element/toHaveElementClass.ts","../src/matchers/element/toHaveElementProperty.ts","../src/matchers/element/toHaveHTML.ts","../src/matchers/element/toHaveHeight.ts","../src/matchers/element/toHaveHref.ts","../src/matchers/element/toHaveId.ts","../src/matchers/element/toHaveSize.ts","../src/matchers/element/toHaveStyle.ts","../src/matchers/element/toHaveText.ts","../src/matchers/element/toHaveValue.ts","../src/matchers/element/toHaveWidth.ts","../src/matchers/elements/toBeElementsArrayOfSize.ts","../src/matchers/mock/toBeRequested.ts","../src/matchers/mock/toBeRequestedTimes.ts","../src/matchers/mock/toBeRequestedWith.ts","../src/matchers/modifiers/some.ts","../src/util/commandOptionsUtils.ts","../src/util/elementsUtil.ts","../src/util/executeCommand.ts","../src/util/formatMessage.ts","../src/util/numberOptionsUtil.ts","../src/util/refetchElements.ts","../src/util/stringUtil.ts","../src/util/waitUntil.ts"],"version":"5.9.3"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expect-webdriverio",
3
- "version": "6.0.2",
3
+ "version": "6.0.4",
4
4
  "author": "Mykola Grybyk <mykola.grybyk@gmail.com>",
5
5
  "description": "WebdriverIO Assertion Library",
6
6
  "license": "MIT",
@@ -44,7 +44,8 @@
44
44
  }
45
45
  ],
46
46
  "./types": "./types/expect-global.d.ts",
47
- "./expect-global": "./types/expect-global.d.ts"
47
+ "./expect-global": "./types/expect-global.d.ts",
48
+ "./api": "./lib/api/index.js"
48
49
  },
49
50
  "types": "./types/expect-webdriverio.d.ts",
50
51
  "typeScriptVersion": "3.8.3",
@@ -22,7 +22,6 @@ type ExpectLibExpectationResult = import('expect').ExpectationResult
22
22
  type ExpectLibMatcherContext = import('expect').MatcherContext
23
23
  type MatchersObject = Parameters<typeof import('expect').expect.extend>[0]
24
24
  type ExpectLibAnything = ReturnType<typeof expect.any> | ReturnType<typeof expect.anything>
25
-
26
25
  type WdioSome<T> = import('../src/matchers/modifiers/some.js').SomeElementsWrapper<T>
27
26
 
28
27
  // Extracted from the expect library, this is the type of the matcher function used in the expect library.
@@ -1264,7 +1263,17 @@ declare namespace ExpectWebdriverIO {
1264
1263
  * Allow to match one of the specified value.
1265
1264
  */
1266
1265
  type OneOfPartialMatcher<T> = ExpectWebdriverIO.PartialMatcher<T[]>
1266
+ }
1267
+
1268
+ declare module 'expect-webdriverio' {
1269
+ export = ExpectWebdriverIO
1270
+ }
1267
1271
 
1272
+ /**
1273
+ * Expose the expect-wdio API without the burden of initialization.
1274
+ * Required since importing from 'expect-webdriverio' can trigger double initialization.
1275
+ */
1276
+ declare module 'expect-webdriverio/api' {
1268
1277
  /**
1269
1278
  * Quantifier modifier. Wraps a `$$()` result so that the matcher passes
1270
1279
  * when at least one element satisfies the condition (∃ semantics).
@@ -1274,11 +1283,7 @@ declare namespace ExpectWebdriverIO {
1274
1283
  * await expect(some($$('.items'))).not.toBeDisplayed() // at least one is NOT displayed
1275
1284
  * await expect(some($$('.items'))).toHaveText('foo')
1276
1285
  */
1277
- function some<T extends ElementArrayLike>(
1286
+ export function some<T extends ElementArrayLike>(
1278
1287
  elements: T
1279
1288
  ): WdioSome<T>
1280
1289
  }
1281
-
1282
- declare module 'expect-webdriverio' {
1283
- export = ExpectWebdriverIO
1284
- }