Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update testing based on Failed to parse src "test-file-stub" on `next… #29039

Merged
merged 10 commits into from
Oct 13, 2021
8 changes: 8 additions & 0 deletions docs/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,14 @@ These files aren't useful in tests but importing them may cause errors, so we wi
module.exports = {};
```

If you're running into the issue ``Failed to parse src "test-file-stub" on `next/image`` add a '/' to your fileMock.

```
// __mocks__/fileMock.js

(module.exports = "/test-file-stub"
```

For more information on handling static assets, please refer to the [Jest Docs](https://jestjs.io/docs/webpack#handling-static-assets).

**Extend Jest with custom matchers**
Expand Down