expect-webdriverio 4.1.3 → 4.2.1

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/jest.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- /// <reference types="./types/expect-webdriverio"/>
1
+ /// <reference types="./types/expect-webdriverio.d.ts"/>
2
2
 
3
3
  declare namespace jest {
4
4
  interface Matchers<R, T> extends ExpectWebdriverIO.Matchers<R, T> { }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expect-webdriverio",
3
- "version": "4.1.3",
3
+ "version": "4.2.1",
4
4
  "author": "Mykola Grybyk <mykola.grybyk@gmail.com>",
5
5
  "description": "WebdriverIO Assertion Library",
6
6
  "license": "MIT",
@@ -28,6 +28,11 @@
28
28
  },
29
29
  "./lib/index.js"
30
30
  ],
31
+ "./jest": [
32
+ {
33
+ "types": "./jest.d.ts"
34
+ }
35
+ ],
31
36
  "./types": "./types/jest-global.d.ts"
32
37
  },
33
38
  "types": "./types/jest-global.d.ts",
@@ -45,39 +50,40 @@
45
50
  "test:lint": "eslint . --ext .js,.jsx,.ts,.tsx",
46
51
  "test:unit": "vitest",
47
52
  "test:types": "node test-types/copy && npm run ts && npm run clean:tests",
48
- "ts": "run-p ts:*",
49
- "ts:default": "cd test-types/default && tsc --incremental",
50
- "ts:jest": "cd test-types/jest && tsc --incremental",
51
- "ts:jasmine": "cd test-types/jasmine && tsc --incremental",
53
+ "ts": "run-s ts:*",
54
+ "ts:default": "cd test-types/default && tsc -p ./tsconfig.json --incremental",
55
+ "ts:jest": "cd test-types/jest && tsc -p ./tsconfig.json --incremental",
56
+ "ts:jasmine": "cd test-types/jasmine && tsc -p ./tsconfig.json --incremental",
52
57
  "watch": "npm run compile -- --watch",
53
58
  "prepare": "husky install"
54
59
  },
55
60
  "devDependencies": {
56
- "@types/jest": "^29.4.0",
57
- "@types/node": "^18.11.18",
58
- "@typescript-eslint/eslint-plugin": "^5.49.0",
59
- "@typescript-eslint/parser": "^5.49.0",
60
- "@vitest/coverage-c8": "^0.30.0",
61
- "@wdio/globals": "^8.2.4",
62
- "c8": "^7.12.0",
63
- "eslint": "^8.32.0",
61
+ "@types/debug": "^4.1.7",
62
+ "@types/jest": "^29.5.1",
63
+ "@types/node": "^18.16.3",
64
+ "@typescript-eslint/eslint-plugin": "^5.59.1",
65
+ "@typescript-eslint/parser": "^5.59.1",
66
+ "@vitest/coverage-c8": "^0.30.1",
67
+ "@wdio/globals": "^8.8.8",
68
+ "c8": "^7.13.0",
69
+ "eslint": "^8.39.0",
64
70
  "eslint-plugin-import": "^2.27.5",
65
71
  "eslint-plugin-unicorn": "^46.0.0",
66
72
  "husky": "^8.0.3",
67
73
  "npm-run-all": "^4.1.5",
68
- "release-it": "^15.6.0",
74
+ "release-it": "^15.10.2",
69
75
  "rimraf": "^3.0.2",
70
76
  "shelljs": "^0.8.5",
71
- "typescript": "^4.9.4",
72
- "vitest": "0.30.0",
73
- "webdriverio": "^8.2.4"
77
+ "typescript": "^5.0.4",
78
+ "vitest": "0.30.1",
79
+ "webdriverio": "^8.8.8"
74
80
  },
75
81
  "optionalDependencies": {
76
- "@wdio/globals": "^8.2.4",
77
- "webdriverio": "^8.2.4"
82
+ "@wdio/globals": "^8.8.8",
83
+ "webdriverio": "^8.8.8"
78
84
  },
79
85
  "dependencies": {
80
- "expect": "^29.4.0",
81
- "jest-matcher-utils": "^29.4.0"
86
+ "expect": "^29.5.0",
87
+ "jest-matcher-utils": "^29.5.0"
82
88
  }
83
89
  }
@@ -1,5 +1,5 @@
1
1
  declare namespace ExpectWebdriverIO {
2
- function expect<T = unknown>(actual: T): Matchers<T, T>
2
+ function expect<T extends Promise<void>>(actual: T): Matchers<T, T>
3
3
  function setOptions(options: DefaultOptions): void
4
4
 
5
5
  interface DefaultOptions {
@@ -1,14 +1,18 @@
1
1
  /// <reference types="./expect-webdriverio.js"/>
2
2
 
3
+ type ChainablePromiseElement = import('webdriverio').ChainablePromiseElement<WebdriverIO.Element>
4
+ type ChainablePromiseArray = import('webdriverio').ChainablePromiseArray<WebdriverIO.Element>
5
+ type ExpectType = WebdriverIO.Element | Promise<WebdriverIO.Element> | ChainablePromiseElement | ChainablePromiseArray
6
+
3
7
  declare namespace ExpectWebdriverIO {
4
- interface Matchers<R, T> extends Readonly<import('expect').Matchers<R>> {
8
+ interface Matchers<R extends Promise<void>, T> extends Readonly<import('expect').Matchers<R>> {
5
9
  not: Matchers<R, T>
6
- resolves: Matchers<Promise<R>, T>
7
- rejects: Matchers<Promise<R>, T>
10
+ resolves: Matchers<R, T>
11
+ rejects: Matchers<R, T>
8
12
  }
9
13
 
10
14
  type Expect = {
11
- <T = unknown>(actual: T): Matchers<T, T>
15
+ <T extends ExpectType, R extends Promise<void>>(actual: T): Matchers<R, T>
12
16
  extend(map: Record<string, Function>): void
13
17
  } & AsymmetricMatchers
14
18