From 91abfd29aa7912d7a8326827c8bb05af0d3e6e22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Wr=C3=B3blewski?= Date: Fri, 28 Apr 2023 15:05:31 +0200 Subject: [PATCH] Add information about jest to readme Mock console.trace to fix errors in jest tests --- README.md | 2 ++ tests/scriptlets/trusted-set-cookie-reload.spec.js | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/README.md b/README.md index dcd0d088..77495af4 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/tests/scriptlets/trusted-set-cookie-reload.spec.js b/tests/scriptlets/trusted-set-cookie-reload.spec.js index d930ea5b..fa26d020 100644 --- a/tests/scriptlets/trusted-set-cookie-reload.spec.js +++ b/tests/scriptlets/trusted-set-cookie-reload.spec.js @@ -21,6 +21,10 @@ beforeEach(() => { jest.fn(), }, }); + + // Mocking console.trace() because + // it causes errors in tests using jest + window.console.trace = jest.fn(); }); afterEach(() => {