4

Is it possible to use ava --watch functionality when i write the tests in typescript?

Now I have something like this

"test": "tsc -p tsconfig.test.json && ava \"dist_test/**/*.js\""

Only it would be nice to have it only test modified source / test files during development.

Chris
  • 8,168
  • 8
  • 36
  • 51

1 Answers1

1

You could use chokidar-cli to detect the file changes and get it to manually run the build and test.

"test": "tsc -p tsconfig.test.json && ava \"dist_test/**/*.js\"",
"test:watch": "chokidar \"dist_test/**/*.js\" -c \"npm run test\" --initial",

Once changes are detected in any files it will run test for you.

Tim
  • 7,746
  • 3
  • 49
  • 83