summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWinnie Hellmann <winnie@gitlab.com>2018-11-08 15:30:50 +0100
committerWinnie Hellmann <winnie@gitlab.com>2018-11-08 15:38:16 +0100
commit239d937ba00229a915822fbd6a22d68651fe5b27 (patch)
tree140adece2ca791fc5dc438862007755002ef9715
parent369631c84195f6b8b26624d5647ae994e64b77e8 (diff)
downloadgitlab-ce-winh-fail-karma-for-warn.tar.gz
Fail tests for calls to console.warn()winh-fail-karma-for-warn
-rw-r--r--spec/javascripts/test_bundle.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/javascripts/test_bundle.js b/spec/javascripts/test_bundle.js
index 96c0844f83c..2d70a6b6cbf 100644
--- a/spec/javascripts/test_bundle.js
+++ b/spec/javascripts/test_bundle.js
@@ -106,6 +106,18 @@ afterEach(() => {
clearTimeout(longRunningTestTimeoutHandle);
});
+beforeEach(done => {
+ const originalWarn = console.warn;
+ spyOn(console, 'warn').and.callFake(message => {
+ if (message.startsWith('[Bootstrap-Vue warn]:')) {
+ done.fail(message);
+ } else {
+ originalWarn(message);
+ }
+ });
+ done();
+});
+
const axiosDefaultAdapter = getDefaultAdapter();
// render all of our tests