webdriverio / webdriverio/expect-webdriverio
Jest Augmentations Limitations
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 86
- Forks
- 61
- Avg merge
- 19h 12m
- Merged PRs (30d)
- 15
Description
As discovered while working on this PR, here are the issues to document the limitations around augmentation usage.
See the augmentation issue for Jasmine there https://github.com/webdriverio/expect-webdriverio/issues/1893
Jest
- As documented here and demonstrated in this project, we can utilize Jest with
@jest/globalsand@types/jestto use Jest's expect with wdio augmentation, but it is not a plug-and-play, out-of-the-box solution. - As shown here, to use Jest’s augmentation, we also need to register the wdio custom matcher manually.
- Additionally, to utilize the soft assertion service, we need to register it, as shown here.
- The typing
@types/jestis not offered and supported by Jest’s maintainer, and there is a long-standing issue around that here to get rid of@types/jest - When using Jest’s augmentation of the wdio matchers
toMatchSnapshotandtoMatchInlineSnapshot, they conflict with one of Jest’s. - A workaround to avoid requiring the registration of the wdio matcher & soft assertion is to force the
global.expect(as shown here) to be one of the wdio options, but this could also break other parts of a monorepo project.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Read the linked PR #1863 and Jasmine augmentation issue #1893, then review the referenced Jest boilerplate setup examples. Document the listed Jest augmentation, matcher-registration, soft-assertion, typing, snapshot-conflict, and global.expect limitations; done means these limitations and workarounds are covered in the repository documentation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100