【发布时间】:2019-08-12 09:16:54
【问题描述】:
我在 cypress 中使用自定义命令,它运行良好。我正在使用 Visual Studio 代码作为编辑器。 我正在寻找如何让智能感知识别自定义命令,发现在https://github.com/cypress-io/cypress-example-todomvc#cypress-intellisense
我添加了 cypress/index.d.ts 文件:
/// <reference types="cypress" />
declare namespace Cypress {
interface Chainable<Subject> {
/**
* Do something
* @example
* cy.doSomething()
*/
doSomething(): Chainable<any>
}}
现在点击spec文件中的doSomething会打开index.d.ts中的声明,有没有办法让vscode在support/commands.js下打开实际的命令实现?
【问题讨论】:
标签: javascript typescript visual-studio-code cypress