chore: supress error messages regarding error boundary in tests (#28)

This commit is contained in:
Satyajit Sahoo
2019-07-23 22:51:39 +02:00
committed by Michał Osadnik
parent 78ccf49627
commit 75d356f3e9
2 changed files with 11 additions and 1 deletions

9
jest/setup.js Normal file
View File

@@ -0,0 +1,9 @@
const error = console.error;
console.error = (...args) =>
// Supress error messages regarding error boundary in tests
/Consider adding an error boundary to your tree to customize error handling behavior/m.test(
args[0]
)
? void 0
: error(...args);

View File

@@ -80,6 +80,7 @@
"testRegex": "/__tests__/.*\\.(test|spec)\\.(js|tsx?)$",
"transform": {
"^.+\\.(js|ts|tsx)$": "babel-jest"
}
},
"setupFiles": ["<rootDir>/jest/setup.js"]
}
}