Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0046008Openbravo ERPA. Platformpublic2021-03-04 18:572021-03-15 10:05
cberner 
cberner 
normalminorhave not tried
closedfixed 
5
 
PR21Q2 
Core
No
0046008: Jest tests don't fail if console.error and console.warn are generated
A jest test should fail if it shows a console.error or console.warn, this is not happening by default, jest doesn't check this.

This check would make sure jest execution's are clean and free of errors and warnings.

Note: If a test intentionally throws a console.error or console.warn, it should mock it accordingly and expect it.
Add a console.error/console.warn to some successful jest test.
Run that jest test, with current behaviour it will be green although some console.error/warn will appear in the process.
No tags attached.
related to defect 0051685 new Triage Platform Base POS2 Storyshots tests failing by asynchronous GridDataSource 
Issue History
2021-03-04 18:57cbernerNew Issue
2021-03-04 18:57cbernerAssigned To => cberner
2021-03-04 18:57cbernerModules => Core
2021-03-04 18:57cbernerTriggers an Emergency Pack => No
2021-03-04 19:02hgbotNote Added: 0126505
2021-03-09 11:04hgbotNote Added: 0126563
2021-03-15 10:04hgbotNote Added: 0126694
2021-03-15 10:05hgbotNote Added: 0126695
2021-03-15 10:05hgbotResolutionopen => fixed
2021-03-15 10:05hgbotStatusnew => closed
2021-03-15 10:05hgbotFixed in Version => PR21Q2
2021-03-15 10:05hgbotNote Added: 0126696
2021-03-15 10:05hgbotNote Added: 0126697
2023-02-23 17:28jarmendarizRelationship addedrelated to 0051685

Notes
(0126505)
hgbot   
2021-03-04 19:02   
Merge Request created: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/324 [^]
(0126563)
hgbot   
2021-03-09 11:04   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.core2/-/merge_requests/361 [^]
(0126694)
hgbot   
2021-03-15 10:04   
Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.core2 [^]
Changeset: 385f8526ff414424ac2f34eb052452710078d7ba
Author: Cristian Berner <cristian.berner@openbravo.com>
Date: 2021-03-15T09:57:11+01:00
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.core2/-/commit/385f8526ff414424ac2f34eb052452710078d7ba [^]

Related to ISSUE-46008: Disable storyshots tests that generate a console.error from grid

Those storyshots currently generate a console.error related with
asynchronous data received in TimeoutDataSource and LazyDataSource, when
fixed, those will be enabled again.

---
M web-jspack/org.openbravo.core2/src/components/FilterableGrid/stories/FilterableGrid.stories.jsx
M web-jspack/org.openbravo.core2/src/components/Grid/stories/GridDataSource.stories.jsx
M web-jspack/org.openbravo.core2/src/components/Grid/stories/GridPaginate.stories.jsx
M web-jspack/org.openbravo.core2/src/components/Grid/stories/GridSorting.stories.jsx
---
(0126695)
hgbot   
2021-03-15 10:05   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.core2/-/merge_requests/361 [^]
(0126696)
hgbot   
2021-03-15 10:05   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/openbravo [^]
Changeset: 920eb47f9dbb18f790c812bcdfbaf5a7305e733e
Author: Cristian Berner <cristian.berner@openbravo.com>
Date: 2021-03-15T09:56:23+01:00
URL: https://gitlab.com/openbravo/product/openbravo/-/commit/920eb47f9dbb18f790c812bcdfbaf5a7305e733e [^]

Fixes FR-46008: Jest tests don't fail when console.warn or console.error appear in a test

This is due to how jest works, it doesn't directly check if a
console.warn or a console.error has been thrown during a test execution.
To check this, console.error and console.warn functions are modified in
jest.setup.js so it handles and fails correctly the test that showed
some console.error/warn.

---
M jest.setup.js
---
(0126697)
hgbot   
2021-03-15 10:05   
Merge request merged: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/324 [^]