Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Anyone has experience using NightWatch with TypeScript?

I am using NightWatch for my e2e testing and want to move towards ES6 way of writing tests. I was able to do it with Babel and it worked fine but I want to use typescript. I could not find much documentation of NightWatch with TypeScript. Found some github repositories:

  • https://github.com/rkavalap/NightWatchTest
  • https://github.com/DonPage/Nightwatch-Typescript-example
  • https://github.com/remojansen/TypeScriptTestingExamples

But these do not contain any detailed documentation around typescript.

Any help would be appreciated!

like image 720
Smriti Avatar asked Jan 10 '17 07:01

Smriti


Video Answer


1 Answers

I haven't tried this, but on other TS projects, I use ts-node as the interpreter.

ts-node ./node_modules/.bin/nightwatch test.ts

You can do this with @vue/cli-plugin-e2e-nightwatch as well.

like image 90
kierans Avatar answered Sep 18 '22 16:09

kierans