feat(ui): fail UI tests if there's anything logged to console

This commit is contained in:
Łukasz Mierzwa
2018-09-08 21:59:54 +01:00
parent 3f8f762ed1
commit fe16358899

View File

@@ -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}`);
};
}