In jest one names a file thing.jest.ts
. You can then run jest thing.jest.ts
or point jest at a folder of test files eg jest some_folder/sub_folder
.
How do I do this with AVA?
Things that don't work:
$ ava /**/*.test.ts
✖ /**/*.test.ts does not exist.
$ ava ./src/Derivations/Sources/__tests/Source.test.ts
$ ts-node ./src/Derivations/Sources/__tests/Source.test.ts
Test files must be run with the AVA CLI:
$ ava src/Derivations/Sources/__tests/Source.test.ts
This just requires some config. By default though, AVA does not currently (Jan 2020) support Typescript files.
https://github.com/avajs/ava/blob/master/docs/recipes/typescript.md
You can configure AVA to recognize TypeScript files. Then, with ts-node installed (
npm i ts-node --save-dev
), you can compile them on the fly.package.json:
{ "ava": { "compileEnhancements": false, "extensions": [ "ts" ], "require": [ "ts-node/register" ] } }