README: Add DOM dump silencing to Test Guidelines
This adds information about silencing DOM dumps in testing-library test output and how to allow DOM dump again if needed.
This commit is contained in:
parent
1febbe4620
commit
1ead9c8e3c
1 changed files with 13 additions and 0 deletions
13
README.md
13
README.md
|
|
@ -260,6 +260,19 @@ npm run test
|
|||
|
||||
These tests will also be run in our CI when a PR is opened.
|
||||
|
||||
Note that `testing-library` DOM printout is currently disabled for all tests by the following configuration in `src/test/setup.ts`:
|
||||
```typescript
|
||||
configure({
|
||||
getElementError: (message: string) => {
|
||||
const error = new Error(message);
|
||||
error.name = 'TestingLibraryElementError';
|
||||
error.stack = '';
|
||||
return error;
|
||||
},
|
||||
});
|
||||
```
|
||||
If you'd like to see the stack printed out you can either temporarily disable the configuration or generate a [Testing Playground](https://testing-playground.com/) link by adding `screen.logTestingPlaygroundURL()` to your test.
|
||||
|
||||
### Using MSW data in development
|
||||
|
||||
If you want to develop in environment with mocked data, run the command `npm run stage-beta:msw`.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue