Native TypeScript support for sindresorhus' awesome AVA test runner out of the box, without a prior build step.
🚀 Zero-configuration setup
⏩ Parallel test execution
🖼 Snapshot testing
📈 All your favorite reporters
This is a fork of the official AVA repository with a couple of minimally invasive changes. Uses ts-node/register
instead of Babel. Not the cleanest solution, but it works pretty well.
npm install --save-dev ava-ts ava ts-node
# Using yarn:
yarn add --dev ava-ts ava ts-node
Write your tests in TypeScript as you would usually do and import from ava
, not from ava-ts
, just as you would always do.
// test.ts
import test from 'ava'
test('one plus two equals three', t => {
t.is(1 + 2, 3)
})
Instead of running ava
, just run the ava-ts
CLI tool instead. That's it!
It will use all the same options and defaults you know from AVA, but searches for *.ts
files instead of *.js
.
See AVA's official docs for detailed information.
There are a few limitations compared to the original ava
CLI, however.
- No babel support
- No power assert
MIT. The fork as well as the original. AVA is a project of always awesome Sindre Sorhus.