Skip to content
This repository was archived by the owner on Feb 28, 2024. It is now read-only.

Might have found an easier way #125

Open
Vadorequest opened this issue Dec 3, 2020 · 1 comment
Open

Might have found an easier way #125

Vadorequest opened this issue Dec 3, 2020 · 1 comment

Comments

@Vadorequest
Copy link

Keeping support/commands.js as a JS file.

And creating a support/commands.d.ts with:

namespace Cypress {
  interface cy extends Chainable<undefined> {
    getCustomer: () => void;
  }
}

Makes it much easier to setup. Declaration and code is separated (commands) but it's much simpler. (and not really an issue either)

Commands do not benefit from TS support though.

@dannysilence
Copy link

the point fir this repo was to show specifically usage of ts, e. g. if you use typescript across your test code, and not to simply demonstrate how to extend suggestions of types which is achieved by js+d.ts

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants