Skip to content

Commit e777d7e

Browse files
committed
test: add test, using ava
1 parent dccd98e commit e777d7e

File tree

4 files changed

+2095
-22
lines changed

4 files changed

+2095
-22
lines changed

circle.yml

+3
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ jobs:
1111
- checkout
1212
- restore_cache:
1313
key: dependency-cache-{{ checksum "yarn.lock" }}
14+
- run:
15+
name: Test
16+
command: yarn test
1417
- run:
1518
name: Install dependencies
1619
command: yarn

package.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515
"lib",
1616
"utils"
1717
],
18-
"scripts": {},
18+
"scripts": {
19+
"test": "ava"
20+
},
1921
"dependencies": {
2022
"cac": "^6.5.2",
2123
"cross-spawn": "^6.0.5",
@@ -24,6 +26,7 @@
2426
"multimatch": "^4.0.0"
2527
},
2628
"devDependencies": {
29+
"ava": "^2.1.0",
2730
"husky": "^1.0.0-rc.13",
2831
"lint-staged": "^7.2.0",
2932
"prettier": "^1.17.0"

test.js

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import test from 'ava'
2+
import spawn from 'cross-spawn'
3+
4+
test('main', t => {
5+
const ps = spawn.sync('./bin/cli.js', ['test'])
6+
const stdout = ps.stdout.toString()
7+
t.is(stdout, '')
8+
})

0 commit comments

Comments
 (0)