AVA-TS
Native TypeScript support for sindresorhus' awesome AVA test runner out of the box, without a prior build step.
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.
Installation
npm install --save-dev ava-ts ava ts-node
yarn add --dev ava-ts ava ts-node
Usage
Write your tests in TypeScript as you would usually do and import from ava
, not from ava-ts
, just as you would always do.
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
.
Documentation
See AVA's official docs for detailed information.
Features
It comes with most of the great features you love:
- Zero-configuration setup
- Parallel test execution
- Snapshot testing
- All your favorite reporters
Limitations
There are a few limitations, however.
- No babel support
- No power assert
License
MIT. The fork as well as the original. AVA is a project of always awesome Sindre Sorhus.