這是我的模塊和測試我想要的功能: import aVariable from 'aModule'
export function afunction() {
//do something with the imported aVariable
//calculates result
return result
});
我想嘲笑aVariable我摩卡單元測試
我很努力地找到一種方法來單元測試貓鼬領域的驗證。目前,我有如下測試: it('should be invalid if googleId is empty',() =>
testBook.googleId = '';
const newBook = new Book(testBook);
return newBook.validate().catch((err) =>