better-mock
better-mock copied to clipboard
[BUG] async function return undifined
问题简述 同步函数 async function 会返回空值undifined
复现步骤 在自带的练习环境中,输入
Mock.mock('http://example.com/path/to', async ()=>{
return await new Promise ((resolver)=>resolver('TEST'))
})
axios.get('http://example.com/path/to').then(res => {
console.log(res.data)
})
截图
