Skip to content

Commit 3f12bbb

Browse files
committed
Review doc by the AI
1 parent ae3b4d6 commit 3f12bbb

3 files changed

Lines changed: 12 additions & 12 deletions

File tree

docs/CustomMatchers.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
Similar to how `expect-webdriverio` extends Jasmine/Jest matchers it's possible to add custom matchers.
44

5-
- Jasmine see [custom matchers](https://jasmine.github.io/tutorials/custom_matchers) doc
6-
- Everyone else see Jest's [expect.extend](https://jestjs.io/docs/en/expect#expectextendmatchers)
5+
- [Jasmine](https://jasmine.github.io/) see [custom matchers](https://jasmine.github.io/tutorials/custom_matchers) doc
6+
- Everyone else see [Jest's expect.extend](https://jestjs.io/docs/en/expect#expectextendmatchers)
77

88
Custom matchers should be added in wdio `before` hook
99

docs/Framework.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ We can pair `expect-webdriverio` with [Jest](https://jestjs.io/), [Mocha](https:
1010

1111
### Jest
1212
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.
1414

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)
1616
- Note: With Jest the matchers `toMatchSnapshot` and `toMatchInlineSnapshot` were overloaded. To resolve correctly the types `expect-webdriverio/jest` must be last.
1717

1818
#### With `@jest/globals`
@@ -95,15 +95,15 @@ Expected in `tsconfig.json`:
9595
```
9696

9797
#### 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.
9999

100100
### Jasmine
101101
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.
102102

103103
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.
104104

105105
#### 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
107107

108108
```ts
109109
describe('My tests', async () => {
@@ -156,7 +156,7 @@ Expected in `tsconfig.json`:
156156
```
157157

158158
#### 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:
160160

161161
```ts
162162
describe('My tests', async () => {

docs/Types.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44
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`.
55

66
- `"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/)
99
- `"expect-webdriverio/expect-global"` // Optional, if you wish to use expect of `expect-webdriverio` globally without explicit import
1010
- Note: Same as the former `"expect-webdriverio/types"`, now deprecated!
1111

1212
## JavaScript (VSCode)
1313

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.
1515

1616
```json
1717
{
@@ -24,7 +24,7 @@ It's required to create `jsconfig.json` in project root and refer to the type de
2424
```
2525

2626
## 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.
2828

2929
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`.
3030

@@ -33,4 +33,4 @@ Support of `expectAsync` keyword is subject to change and may be dropped in the
3333
### Dependency on `@wdio/jasmine-framework`
3434
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.
3535

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

Comments
 (0)