1

我想导入一个节点模块并将其添加到我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在我的测试用例中使用

4

0 回答 0