Open Vadorequest opened 3 years ago
Keeping support/commands.js as a JS file.
support/commands.js
And creating a support/commands.d.ts with:
support/commands.d.ts
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.
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
Keeping
support/commands.js
as a JS file.And creating a
support/commands.d.ts
with: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.