blessing-skin-server/resources/assets/tests/setup.js

21 lines
459 B
JavaScript
Raw Normal View History

2018-07-27 16:54:36 +08:00
import 'jest-extended';
import Vue from 'vue';
2018-07-27 18:54:39 +08:00
window.blessing = {
base_url: ''
};
2018-07-31 10:18:14 +08:00
console.log = console.warn = console.error = () => {};
2018-07-27 16:54:36 +08:00
Vue.prototype.$t = key => key;
Vue.directive('t', (el, { value }) => {
if (typeof value === 'string') {
el.innerHTML = value;
} else if (typeof value === 'object') {
el.innerHTML = value.path;
} else {
throw new Error('[i18n] Invalid arguments in `v-t` directive.');
}
});