mirror of
https://github.com/prymitive/karma
synced 2026-05-19 04:26:41 +00:00
feat(ui): fail UI tests if there's anything logged to console
This commit is contained in:
@@ -16,3 +16,10 @@ require("jest-date-mock");
|
||||
// fetch is used in multiple places to interact with Go backend
|
||||
// or upstream Alertmanager API
|
||||
global.fetch = require("jest-fetch-mock");
|
||||
|
||||
// ensure that all console messages throw errors
|
||||
for (const level of ["error", "warn", "info", "log", "trace"]) {
|
||||
global.console[level] = (message, ...args) => {
|
||||
throw new Error(`message=${message} args=${args}`);
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user