Skip to content

Commit fe34ddd

Browse files
authored
Clarify usage with AVA 3
1 parent a3b205a commit fe34ddd

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

README.md

+12-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,21 @@
11
# @ava/typescript
22

3-
Adds [TypeScript](https://www.typescriptlang.org/) support to [AVA](https://avajs.dev).
3+
Adds [TypeScript](https://www.typescriptlang.org/) support to [AVA 4](https://avajs.dev).
44

55
This is designed to work for projects that precompile TypeScript. It allows AVA to load the compiled JavaScript, while configuring AVA to treat the TypeScript files as test files.
66

77
In other words, say you have a test file at `src/test.ts`. You've configured TypeScript to output to `build/`. Using `@ava/typescript` you can run the test using `npx ava src/test.ts`.
88

9+
## For AVA 3 users
10+
11+
Use version 2:
12+
13+
```console
14+
npm install --save-dev @ava/typescript@2
15+
```
16+
17+
Note that v2 does not support ES modules. This requires v3 and AVA 4.
18+
919
## Enabling TypeScript support
1020

1121
Add this package to your project:
@@ -41,7 +51,7 @@ AVA searches your entire project for `*.js`, `*.cjs`, `*.mjs` and `*.ts` files (
4151

4252
## ES Modules
4353

44-
When used with AVA 4, if your `package.json` has configured `"type": "module"`, or you've configured AVA to treat the `js` extension as `module`, then `@ava/typescript` will import the output file as an ES module. Note that this is based on the *output file*, not the `ts` extension.
54+
If your `package.json` has configured `"type": "module"`, or you've configured AVA to treat the `js` extension as `module`, then `@ava/typescript` will import the output file as an ES module. Note that this is based on the *output file*, not the `ts` extension.
4555

4656
## Add additional extensions
4757

0 commit comments

Comments
 (0)