Skip to content

Commit 66d483c

Browse files
Winnie HellmannNataliaTepluhina
Winnie Hellmann
authored andcommitted
Add workaround for Vue test utils setProps
see vuejs/vue-test-utils#631 (comment)
1 parent 0973d76 commit 66d483c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Diff for: spec/javascripts/test_bundle.js

+10
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,16 @@ Vue.config.productionTip = false;
2121

2222
let hasVueWarnings = false;
2323
Vue.config.warnHandler = (msg, vm, trace) => {
24+
// The following workaround is necessary, so we are able to use setProps from Vue test utils
25+
// see https://github.com/vuejs/vue-test-utils/issues/631#issuecomment-421108344
26+
const currentStack = new Error('').stack;
27+
const isInVueTestUtils = currentStack
28+
.split('\n')
29+
.some(line => line.startsWith(' at VueWrapper.setProps ('));
30+
if (isInVueTestUtils) {
31+
return;
32+
}
33+
2434
hasVueWarnings = true;
2535
fail(`${msg}${trace}`);
2636
};

0 commit comments

Comments
 (0)