【发布时间】:2020-10-12 08:31:45
【问题描述】:
我的项目中有这个笑话
const action = async () => {
await hotelService.getByIdAsync(Identifier);
};
await expect(action()).rejects.toThrowError(FunctionalError);
但我有这个 eslint 错误
92:28 error Missing return type on function @typescript-eslint/explicit-function-return-type
【问题讨论】:
-
动作函数没有返回任何东西,因此你期望它抛出错误。
-
ESLint 消息中有什么不清楚的地方?您是否阅读了规则的指南?请注意,您可能希望对测试使用不同的、更宽松的 linting 规则。
标签: javascript node.js typescript async-await jestjs