summaryrefslogtreecommitdiff
path: root/spec/javascripts/test_bundle.js
diff options
context:
space:
mode:
authorWinnie Hellmann <winnie@gitlab.com>2019-01-25 10:54:54 +0100
committerWinnie Hellmann <winnie@gitlab.com>2019-01-25 10:59:05 +0100
commita71d02bb161571ddadba50e8737c70bf47aa944d (patch)
treeb11c06845bda8213b1945145942e4d67fa44917d /spec/javascripts/test_bundle.js
parent965dbbd24c3554452842e46f21aaf0dabee636bd (diff)
downloadgitlab-ce-a71d02bb161571ddadba50e8737c70bf47aa944d.tar.gz
Add workaround for Vue test utils setProps
see https://github.com/vuejs/vue-test-utils/issues/631#issuecomment-421108344
Diffstat (limited to 'spec/javascripts/test_bundle.js')
-rw-r--r--spec/javascripts/test_bundle.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/javascripts/test_bundle.js b/spec/javascripts/test_bundle.js
index 547379dabed..1ea37c791ee 100644
--- a/spec/javascripts/test_bundle.js
+++ b/spec/javascripts/test_bundle.js
@@ -21,6 +21,16 @@ Vue.config.productionTip = false;
let hasVueWarnings = false;
Vue.config.warnHandler = (msg, vm, trace) => {
+ // The following workaround is necessary, so we are able to use setProps from Vue test utils
+ // see https://github.com/vuejs/vue-test-utils/issues/631#issuecomment-421108344
+ const currentStack = new Error('').stack;
+ const isInVueTestUtils = currentStack
+ .split('\n')
+ .some(line => line.startsWith(' at VueWrapper.setProps ('));
+ if (isInVueTestUtils) {
+ return;
+ }
+
hasVueWarnings = true;
fail(`${msg}${trace}`);
};