refactor [P-137]: изолирование документации
This commit is contained in:
1 parent
15e7f45919
commit
895ba23872
352 files changed
+214150
-1593
No files matched your search
@@ -0,0 +1,44 @@
|
||||
import * as VueCompilerDOM from '@vue/compiler-dom';
|
||||
import * as VueServerRenderer from '@vue/server-renderer';
|
||||
import * as Vue from 'vue';
|
||||
import 'jest-transform-stub';
|
||||
|
||||
global.Vue = Vue;
|
||||
global.VueCompilerDOM = VueCompilerDOM;
|
||||
global.VueServerRenderer = VueServerRenderer;
|
||||
|
||||
if (typeof global.localStorage === 'undefined') {
|
||||
global.localStorage = {
|
||||
getItem: () => 'dummy-access-token',
|
||||
setItem: () => {},
|
||||
removeItem: () => {},
|
||||
};
|
||||
}
|
||||
|
||||
jest.mock('axios', () => {
|
||||
return {
|
||||
create: jest.fn(() => ({
|
||||
defaults: { headers: { common: {} } },
|
||||
interceptors: {
|
||||
request: { use: jest.fn() },
|
||||
response: { use: jest.fn() },
|
||||
},
|
||||
get: jest.fn(() => Promise.resolve({ data: { mess: '', result: [] } })),
|
||||
})),
|
||||
};
|
||||
});
|
||||
|
||||
/* eslint-disable */
|
||||
const originalWarn = console.warn;
|
||||
beforeEach(() => {
|
||||
jest.spyOn(console, 'warn').mockImplementation((message) => {
|
||||
if (!message.includes('resolveComponent can only be used in render() or setup()')) {
|
||||
originalWarn(message);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
console.warn.mockRestore();
|
||||
});
|
||||
/* eslint-enable */
|
||||
Reference in new issue
Block a user