Skip to content
This repository has been archived by the owner on Jul 21, 2020. It is now read-only.
/ ava-ts Public archive

🚀 Fork of the AVA test runner with native typescript support

License

Notifications You must be signed in to change notification settings

andywer/ava-ts

Repository files navigation

AVA-TS

Build Status NPM Version

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.

Installation

npm install --save-dev ava-ts ava ts-node

# Using yarn:
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.

// 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.

Documentation

See AVA's official docs for detailed information.

Limitations

There are a few limitations compared to the original ava CLI, 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.