diff options
author | Winnie Hellmann <winnie@gitlab.com> | 2019-01-25 12:54:54 +0300 |
---|---|---|
committer | Winnie Hellmann <winnie@gitlab.com> | 2019-01-25 12:59:05 +0300 |
commit | a71d02bb161571ddadba50e8737c70bf47aa944d (patch) | |
tree | b11c06845bda8213b1945145942e4d67fa44917d /spec/javascripts/test_bundle.js | |
parent | 965dbbd24c3554452842e46f21aaf0dabee636bd (diff) |
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.js | 10 |
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}`); }; |