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 #1893
Jest
- As documented here and demonstrated in this project, we can utilize Jest with
@jest/globals and @types/jest to 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/jest is 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
toMatchSnapshot and toMatchInlineSnapshot, 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.