Skip to content

Commit

Permalink
multiple XHR errors need to be ignored
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasnetau committed Oct 17, 2023
1 parent efcb38d commit 2be8d45
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tests/setup-jest.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@ global.FB_EN_US = langFiles['en-US']

/** Hack to silence errors from default request to assets/lang/en-US.lang **/
const originalConsoleError = console.error
const jsDomCssError = 'Error: AggregateError'
const jsIgnoreErrors = [
'Error: AggregateError',
'Error: connect ECONNREFUSED ::1:80',
]
console.error = (...params) => {
if (!params.find(p => p.toString().includes(jsDomCssError))) {
if (!params.find(p => jsIgnoreErrors.find(ignore => p.toString().includes(ignore)))) {
originalConsoleError(...params)
}
}

0 comments on commit 2be8d45

Please sign in to comment.