Skip to content

Commit

Permalink
Add information about jest to readme
Browse files Browse the repository at this point in the history
Mock console.trace to fix errors in jest tests
  • Loading branch information
AdamWr committed Apr 28, 2023
1 parent c5c53db commit 91abfd2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,8 @@ Run next command
yarn browserstack
```

Tests run by `jest` should be named `.spec.js`, so they will be not included in the `QUnit` tests.

### Debugging

Use `debugger;` statement where you need it, run
Expand Down
4 changes: 4 additions & 0 deletions tests/scriptlets/trusted-set-cookie-reload.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ beforeEach(() => {
jest.fn(),
},
});

// Mocking console.trace() because
// it causes errors in tests using jest
window.console.trace = jest.fn();
});

afterEach(() => {
Expand Down

0 comments on commit 91abfd2

Please sign in to comment.