Skip to content

Commit 2f418b7

Browse files
authored
chore: added ava for testing (#60)
1 parent c514442 commit 2f418b7

File tree

4 files changed

+865
-12
lines changed

4 files changed

+865
-12
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,8 @@ jobs:
3838
- name: Lint
3939
run: yarn lint
4040

41+
- name: Tests
42+
run: yarn test
43+
4144
- name: Build
4245
run: yarn build

package.json

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"build": "tsc",
1414
"prepack": "yarn build",
1515
"lint": "yarn eslint --ext .ts,.js,.mjs src",
16-
"test": "yarn lint",
16+
"test": "ava",
1717
"dev": "cd example && netlify dev"
1818
},
1919
"dependencies": {
@@ -34,8 +34,21 @@
3434
"@types/etag": "^1.8.1",
3535
"@types/fs-extra": "^9.0.13",
3636
"@types/node-fetch": "^2.6.1",
37+
"ava": "^4.3.1",
38+
"esbuild-node-loader": "^0.8.0",
3739
"eslint": "8.22.0",
3840
"jiti": "^1.13.0",
3941
"typescript": "^4.6.2"
42+
},
43+
"ava": {
44+
"extensions": {
45+
"ts": "module"
46+
},
47+
"nodeArguments": [
48+
"--loader=esbuild-node-loader"
49+
],
50+
"files": [
51+
"test/**/*.test.ts"
52+
]
4053
}
4154
}

test/fake.test.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import test from 'ava'
2+
3+
test('sample test', (t) => {
4+
t.pass()
5+
})

0 commit comments

Comments
 (0)