Skip to content

Commit fc93098

Browse files
committed
Test our type definitions with multiple TS versions
To avoid accidentally breaking compatibility with older TypeScript versions, test with each supported version.
1 parent cb5f9f7 commit fc93098

File tree

3 files changed

+22
-2
lines changed

3 files changed

+22
-2
lines changed

.github/workflows/ci.yml

+20
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,26 @@ jobs:
3333
- run: npm test
3434
- uses: codecov/codecov-action@v1
3535

36+
typescript:
37+
name: TypeScript compatibility
38+
runs-on: ubuntu-latest
39+
strategy:
40+
matrix:
41+
ts-version: [~3.7.5, ~3.8]
42+
steps:
43+
- uses: actions/checkout@v1
44+
with:
45+
fetch-depth: 1
46+
- uses: actions/setup-node@v1
47+
with:
48+
node-version: ^12
49+
- run: npm ci --no-audit
50+
- run: npm i typescript@${TS_VERSION}
51+
env:
52+
TS_VERSION: ${{ matrix.ts-version }}
53+
- run: npm ls typescript
54+
- run: npx tsd
55+
3656
lockfile_churn:
3757
name: Test package-lock for unexpected modifications
3858
runs-on: ubuntu-latest

docs/recipes/typescript.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ AVA comes bundled with a TypeScript definition file. This allows developers to l
66

77
Out of the box AVA does not load TypeScript test files, however. Rudimentary support is available via the [`@ava/typescript`] package. You can also use AVA with [`ts-node`]. Read on for details.
88

9-
This guide assumes you've already set up TypeScript for your project. Note that AVA's definition has been tested with version 3.7.5.
9+
This guide assumes you've already set up TypeScript for your project. Note that AVA's definition expects at least version 3.7.5.
1010

1111
## Enabling AVA's TypeScript support
1212

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@
130130
"tempy": "^0.5.0",
131131
"touch": "^3.1.0",
132132
"tsd": "^0.11.0",
133-
"typescript": "^3.7.5",
133+
"typescript": "^3.8.3",
134134
"xo": "^0.28.2",
135135
"zen-observable": "^0.8.15"
136136
},

0 commit comments

Comments
 (0)