Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Update tsconfig.json docs link in the TS recipe
  • Loading branch information
sindresorhus committed Oct 15, 2017
1 parent 837b0dd commit 68ce4b8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion docs/recipes/typescript.md
Expand Up @@ -4,6 +4,7 @@ Translations: [Espa帽ol](https://github.com/avajs/ava-docs/blob/master/es_ES/doc

AVA comes bundled with a TypeScript definition file. This allows developers to leverage TypeScript for writing tests.


## Setup

First install [TypeScript](https://github.com/Microsoft/TypeScript) (if you already have it installed, make sure you use version 2.1 or greater).
Expand All @@ -12,7 +13,7 @@ First install [TypeScript](https://github.com/Microsoft/TypeScript) (if you alre
$ npm install --save-dev typescript
```

Create a [`tsconfig.json`](https://github.com/Microsoft/TypeScript/wiki/tsconfig.json) file. This file specifies the compiler options required to compile the project or the test file.
Create a [`tsconfig.json`](http://www.typescriptlang.org/docs/handbook/tsconfig-json.html) file. This file specifies the compiler options required to compile the project or the test file.

```json
{
Expand Down Expand Up @@ -49,6 +50,7 @@ test(async (t) => {
});
```


## Working with [`context`](https://github.com/avajs/ava#test-context)

By default, the type of `t.context` will be [`any`](https://www.typescriptlang.org/docs/handbook/basic-types.html#any). AVA exposes an interface `RegisterContextual<T>` which you can use to apply your own type to `t.context`. This can help you catch errors at compile-time:
Expand Down Expand Up @@ -79,6 +81,7 @@ test('an actual test', t => {
});
```


## Execute the tests

```
Expand Down

0 comments on commit 68ce4b8

Please sign in to comment.