mirror of
https://github.com/bs-community/blessing-skin-server.git
synced 2024-12-21 06:19:38 +08:00
27 lines
560 B
JavaScript
27 lines
560 B
JavaScript
import 'jest-extended';
|
|
import Vue from 'vue';
|
|
|
|
window.blessing = {
|
|
base_url: '',
|
|
site_name: 'Blessing Skin'
|
|
};
|
|
|
|
console.log = console.warn = console.error = () => {};
|
|
|
|
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.');
|
|
}
|
|
});
|
|
|
|
Vue.prototype.$http = {
|
|
get: jest.fn(),
|
|
post: jest.fn(),
|
|
};
|