错误消息:
‘expect’ was used when there was no current spec, this could be because an asynchronous test timed out
![](https://img.laitimes.com/img/__Qf2AjLwojIjJCLyojI0JCLicmbw5SZ5gDNxEDN1kzN0EmMlljY4MzN0YDOkBzMlBjNhdzNj9CX5d2bs92Yl1iclB3bsVmdlR2LcNWaw9CXt92Yu4GZjlGbh5yYjV3Lc9CX6MHc0RHaiojIsJye.png)
describe('Jerry for Spartacus unit test', () => {
const valueService = new ValueService();
expect(valueService.getValue()).toEqual('Jerry');
} );
解决方法
describe('Jerry for Spartacus unit test', () => {
it('#getValue unit test here!', () => {
const valueService = new ValueService();
expect(valueService.getValue()).toEqual('Jerry');
});
});