You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
❄️ Bugfix Flaky Unit Tests For JavaScript Subprojects #364
Developing some new Hooks we noticed some strange behavior between independet JS Subprojects when we executed our unit tests with jest.
It seems that mocking modules in different subprojects causes some tests to fail when executed together although they are independent and there mocks should be seperate.
Until now we are not quite sure why this happens. We think it could be a problem related to es/commonJS modules
changed the title [-]❄️Bugfix Flaky Unit Tests For JavaScript Subprojects[/-][+]❄️ Bugfix Flaky Unit Tests For JavaScript Subprojects[/+]on Apr 16, 2021
I would guess that the tests are not executed independently. Jest also gives an appropriate warning about the duplicate mocks.
jest-haste-map: duplicate manual mock found: axios
The following files share their name; please delete one of them:
* <rootDir>/generic-webhook/__mocks__/axios.js
* <rootDir>/teams-webhook/__mocks__/axios.js
jest-haste-map: duplicate manual mock found: axios
The following files share their name; please delete one of them:
* <rootDir>/hooks/generic-webhook/__mocks__/axios.js
* <rootDir>/hooks/teams-webhook/__mocks__/axios.js
I would guess that the tests are not executed independently. Jest also gives an appropriate warning about the duplicate mocks.
jest-haste-map: duplicate manual mock found: axios
The following files share their name; please delete one of them:
* <rootDir>/generic-webhook/__mocks__/axios.js
* <rootDir>/teams-webhook/__mocks__/axios.js
jest-haste-map: duplicate manual mock found: axios
The following files share their name; please delete one of them:
* <rootDir>/hooks/generic-webhook/__mocks__/axios.js
* <rootDir>/hooks/teams-webhook/__mocks__/axios.js
Activity
[-]Flaky Unit Tests For JavaScript Subprojects[/-][+]❄️Flaky Unit Tests For JavaScript Subprojects[/+][-]❄️Flaky Unit Tests For JavaScript Subprojects[/-][+]❄️Bugfix Flaky Unit Tests For JavaScript Subprojects[/+][-]❄️Bugfix Flaky Unit Tests For JavaScript Subprojects[/-][+]❄️ Bugfix Flaky Unit Tests For JavaScript Subprojects[/+]twwd commentedon Apr 16, 2021
I would guess that the tests are not executed independently. Jest also gives an appropriate warning about the duplicate mocks.
twwd commentedon Apr 16, 2021
Also see jestjs/jest#2070
nigthknight commentedon Apr 16, 2021
That is correct but on this branch https://github.com/fuhrmeistery/secureCodeBox/tree/feature/notification-hook
We removed both custom mock implementations completely and use jest.mock() instead and the issue still persisted
Upgrading kubeaudit from v0.14.2 to v0.15.0
Weltraumschaf commentedon Jul 20, 2023
Seems not to be a problem anymore.