Working example using typescript? #2707
-
Hi there, does anyone have any working examples of using nightwatch with typescript with the newly added support added in v1.6? When I try to run tests with import statements for the types I get errors when I run the nightwatch command to execute the .ts files "SyntaxError: Cannot use import statement outside a module" |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Hey! Please see this comment. |
Beta Was this translation helpful? Give feedback.
-
Thanks! I ended up changing my npm test command to tsc && nightwatch Then, in my project I put the .ts files in the /ts directory and have tsc output the js tests to /test In my nightwatch.conf.js I changed src_folders to just look at ["test"] which picks up the compiled/output js version of the tests and that all seems to work ok now. |
Beta Was this translation helpful? Give feedback.
Hey! Please see this comment.