typescript - 当 tslint 中的 "no-floating-promises"为真时如何忽略 Jasmine promise

标签 typescript protractor tslint jasmine2.0

有没有办法打开“无 float promise ”但让它忽略像“toEqual”、“toBe”等 Jasmine promise ?我想使用它,但它到处提示我的期望语句。

expect(1).toEqual(1)  // Would complain about this

例如:enter image description here

最佳答案

我用 void Jasmine 期望的关键字。虽然有一些关于它有多合适的讨论:https://github.com/palantir/tslint/issues/4653

void expect(1).toEqual(1)  // Would not complain about this

关于typescript - 当 tslint 中的 "no-floating-promises"为真时如何忽略 Jasmine promise ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56938854/

相关文章:

reactjs - 如何修复 "React Hook useEffect has a missing dependency. Either include it or remove the dependency array"问题?

selenium - 无法更新 chromedriver 和 seleniumrelease

jasmine - Protractor 测试报告

typescript - 如何在 Typescript 中切换 boolean 值?

typescript - 将方法添加到角度 FormControl 类

node.js - Visual Studio 2013 可以在 Node Js Web 应用程序中调试客户端 JavaScript

node.js - nodejs如何在其他文件中使用promise输出并修改它然后返回它的值

Angular 11 : subscribe is deprecated: Use an observer instead?

typescript - 错误 : use-life-cycle-interface requires type checking

typescript - tslint 中的 "no-string-literal"规则是什么?