You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/Framework.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,9 +10,9 @@ We can pair `expect-webdriverio` with [Jest](https://jestjs.io/), [Mocha](https:
10
10
11
11
### Jest
12
12
We can use `expect-webdriverio` with [Jest](https://jestjs.io/) with either the [`@jest/globals`](https://www.npmjs.com/package/@jest/globals) (preferred) or the [`@types/jest`](https://www.npmjs.com/package/@types/jest) (has global imports support)
13
-
- Note: Jest maintainers do not support `@types/jest`. In case this library gets out of date or has problems, support might be dropped.
13
+
- Note: Jest maintainers do not support [`@types/jest`](https://www.npmjs.com/package/@types/jest). In case this library gets out of date or has problems, support might be dropped.
14
14
15
-
In each case, when used <u>**outside of [WDIO Testrunner](https://webdriver.io/docs/clioptions)**</u>, types are required to be added in your `tsconfig.json`
15
+
In each case, when used <u>**outside of [WDIO Testrunner](https://webdriver.io/docs/clioptions)**</u>, types are required to be added in your [`tsconfig.json`](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html)
16
16
- Note: With Jest the matchers `toMatchSnapshot` and `toMatchInlineSnapshot` were overloaded. To resolve correctly the types `expect-webdriverio/jest` must be last.
17
17
18
18
#### With `@jest/globals`
@@ -95,15 +95,15 @@ Expected in `tsconfig.json`:
95
95
```
96
96
97
97
#### Chai
98
-
TODO - Integration with [Chai](https://www.chaijs.com/) assertion library
98
+
TODO - Integration with [Chai](https://www.chaijs.com/) assertion library. See [`@types/chai`](https://www.npmjs.com/package/@types/chai) for type definitions.
99
99
100
100
### Jasmine
101
101
When paired with [Jasmine](https://jasmine.github.io/), [`@wdio/jasmine-framework`](https://www.npmjs.com/package/@wdio/jasmine-framework) is also required to have it configured correctly as it needs to force the `expect` to be `expectAsync` and also to register the wdio matchers with `addAsyncMatcher` since `expect-webdriverio` only supports the jest style `expect.extend` version.
102
102
103
103
The types `expect-webdriverio/jasmine` is still offers but subject to removal or to be moved into `@wdio/jasmine-framework`. The usage of `expectAsync` is also subject to future removal.
104
104
105
105
#### Jasmine `expectAsync`
106
-
Since the above types augment the `AsyncMatcher` of `Jasmine` then with this library alone it look like the below even though it is not runnable since the matcher are not registered
106
+
Since the above types augment the `AsyncMatcher` of `Jasmine` then with this library alone it looks like the below even though it is not runnable since the matchers are not registered
107
107
108
108
```ts
109
109
describe('My tests', async () => {
@@ -156,7 +156,7 @@ Expected in `tsconfig.json`:
156
156
```
157
157
158
158
#### Asymmetric matcher
159
-
Asymmetric matcher has limited support, even though `jasmine.stringContaining` has not error it is potential not working even with `@wdio/jasmine-framework`, but the below should:
159
+
Asymmetric matcher has limited support, even though `jasmine.stringContaining` has no error it is potentially not working even with `@wdio/jasmine-framework`, but the below should:
Copy file name to clipboardExpand all lines: docs/Types.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,14 +4,14 @@
4
4
If you are using the [WDIO Testrunner](https://webdriver.io/docs/clioptions) everything will be automatically setup. Just follow the [setup guide](https://webdriver.io/docs/typescript#framework-setup) from the docs. However if you run WebdriverIO with a different testrunner or in a simple Node.js script you will need to add `expect-webdriverio` to `types` in the `tsconfig.json`.
5
5
6
6
-`"expect-webdriverio"` for everyone except Jasmine/Jest users.
7
-
-`"expect-webdriverio/jasmine"` for Jasmine
8
-
-`"expect-webdriverio/jest"` for Jest
7
+
-`"expect-webdriverio/jasmine"` for [Jasmine](https://jasmine.github.io/)
8
+
-`"expect-webdriverio/jest"` for [Jest](https://jestjs.io/)
9
9
-`"expect-webdriverio/expect-global"` // Optional, if you wish to use expect of `expect-webdriverio` globally without explicit import
10
10
- Note: Same as the former `"expect-webdriverio/types"`, now deprecated!
11
11
12
12
## JavaScript (VSCode)
13
13
14
-
It's required to create `jsconfig.json` in project root and refer to the type definitions to make autocompletion work in vanilla js.
14
+
It's required to create [`jsconfig.json`](https://code.visualstudio.com/docs/languages/jsconfig) in project root and refer to the type definitions to make autocompletion work in vanilla js.
15
15
16
16
```json
17
17
{
@@ -24,7 +24,7 @@ It's required to create `jsconfig.json` in project root and refer to the type de
24
24
```
25
25
26
26
## Jasmine special case
27
-
Jasmine is different from Jest or the standard `expect` definition since it supports promises using `expectAsync` which make it quite challenging.
27
+
[Jasmine](https://jasmine.github.io/) is different from [Jest](https://jestjs.io/) or the standard `expect` definition since it supports promises using `expectAsync` which makes it quite challenging.
28
28
29
29
Even though this library by itself is not fully Jasmine-ready, it offers the types of the matcher only on the `AsyncMatcher` since using `jasmine.expect` does not work out-of-the-box. However, if you are pulling on the `expect` of `expect-webdriverio`, you will be able to have the WebDriverIO matcher types on `expect`.
30
30
@@ -33,4 +33,4 @@ Support of `expectAsync` keyword is subject to change and may be dropped in the
33
33
### Dependency on `@wdio/jasmine-framework`
34
34
As mentioned above, this library alone is not working with Jasmine. It is required to manually do some tweaks, or it is strongly recommended to also pair it with `@wdio/jasmine-framework`. See [Framework.md](Framework.md) for more information.
35
35
36
-
When using `@wdio/jasmine-framework`, since it replaces `jasmine.expect` with `jasmine.expectAsync`, then matchers are usable on the keyword `expect`, but still typing on `expect` directly from Jasmine namespace is not supported as of today!
36
+
When using [`@wdio/jasmine-framework`](https://www.npmjs.com/package/@wdio/jasmine-framework), since it replaces `jasmine.expect` with `jasmine.expectAsync`, then matchers are usable on the keyword `expect`, but still typing on `expect` directly from [Jasmine](https://jasmine.github.io/) namespace is not supported as of today!
0 commit comments