我想导入一个节点模块并将其添加到我command.ts
的 in cypress 中。本教程建议添加
import 'cypress-mailhog';
到command.js
文件。当我将它添加到我的command.ts
文件时,我无法使用该命令,例如
cy.mhGetMailsBySubject
错误是TS2339: Property 'mhGetMailsBySubject' does not exist on type 'cy & EventEmitter'.
我尝试使用的模块是 https://www.npmjs.com/package/cypress-mailhog
在我的 tsconfig.json 文件中,我有以下内容
"target": "es6",
"module": "commonjs",
"lib": ["dom","es6", "es5", "dom.iterable"]
我怎么能mhGetMailsBySubject
在我的测试用例中使用