feat: 优化单测模拟数据格式,避免eslint报错提示造成卡顿

This commit is contained in:
刘洪洪
2023-02-17 15:28:43 +08:00
parent 524be68781
commit d788657048
14 changed files with 2245 additions and 2242 deletions

View File

@@ -55,6 +55,7 @@ let wrapper = null
function axiosPostAndMounted (Metric) {
require('vue-router').useRoute.mockReturnValue({ query: {} })
// 模拟localStorage获取数据
// eslint-disable-next-line no-proto
jest.spyOn(localStorage.__proto__, 'getItem').mockImplementation(key => linkInfo)
// 模拟 axios 数据
axios.get.mockResolvedValueOnce(mockGet)