Chaining custom commands and typescript #2714
Unanswered
reallymello
asked this question in
Help Needed
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm still new to typescript and I'm experimenting with converting existing nightwatch projects to using typescript. What is the best way/pattern to include the methods brought in through custom commands and have them work in chaining?
For example, in the below example I am trying to chain in .axeInject() and then .axeRun after calling assert which returns NightwatchAPI, but since it doesn't exist there (since JS + Nightwatch adds it in through the custom_commands functionality) it errors since TypeScript is more strict.
"Property 'axeInject' does not exist on type '(browser: ICustomBrowser) => void'.ts(2339)"
Beta Was this translation helpful? Give feedback.
All reactions