From 01ea24099acfb98f3990d2db3ad9f215c051eb1c Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Mon, 27 Sep 2021 21:26:07 +0200 Subject: [PATCH] warnings throw errors when running unit tests --- frontend/test/testSetup.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/frontend/test/testSetup.js b/frontend/test/testSetup.js index 7005ff5be..daf862548 100644 --- a/frontend/test/testSetup.js +++ b/frontend/test/testSetup.js @@ -1,6 +1,7 @@ import { createLocalVue } from '@vue/test-utils' import { BootstrapVue, IconsPlugin } from 'bootstrap-vue' import Vuex from 'vuex' +import Vue from 'vue' import { ValidationProvider, ValidationObserver, extend } from 'vee-validate' import * as rules from 'vee-validate/dist/rules' @@ -47,3 +48,8 @@ global.localVue.component('validation-provider', ValidationProvider) global.localVue.component('validation-observer', ValidationObserver) global.localVue.directive('click-outside', clickOutside) global.localVue.directive('focus', focus) + +// throw errors for vue warnings to force the programmers to take care about warnings +Vue.config.warnHandler = (w) => { + throw new Error(w) +}