源代碼:
it('should be created', async(() => {
expect(component).toBeTruthy();
}));
![](https://img.laitimes.com/img/__Qf2AjLwojIjJCLyojI0JCLicmbw5CZ2MWMhZmMyITOxQDMhFGOjNWZ0IWO3ITN1EjN4IDN58CX5d2bs92Yl1iclB3bsVmdlR2LcNWaw9CXt92Yu4GZjlGbh5yYjV3Lc9CX6MHc0RHaiojIsJye.png)
toBeTruthy的實作,用兩個邏輯操作符,檢測actual是否為true:
源代碼:
it('should be created', async(() => {
expect(component).toBeTruthy();
}));
toBeTruthy的實作,用兩個邏輯操作符,檢測actual是否為true: