better-mock icon indicating copy to clipboard operation
better-mock copied to clipboard

[BUG] async function return undifined

Open hks2002 opened this issue 3 years ago • 0 comments

问题简述 同步函数 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)
})

截图 image

hks2002 avatar Jan 05 '23 01:01 hks2002