import * as fs from 'fs'
const path = './a.log'
function log(message){
fs.appendFile(path,message,(err)=>{})
}
import fs from 'fs'
test('log',()=>{
const spy = vi.spyOn(fs,'appendFile').mockImplementation((...args)=>{})
log()
expect(spy).toHaveBeenCalledTimes(1);
})
但是这个好像报错了..