Skip to content

Commit 955870c

Browse files
committed
refactor(ava): move from mocha to ava
1 parent 14b4669 commit 955870c

File tree

4 files changed

+1455
-211
lines changed

4 files changed

+1455
-211
lines changed

.babelrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"presets": ["env"]
3+
}

package.json

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
],
1111
"scripts": {
1212
"commit": "git cz",
13-
"test": "mocha --require tests/config/setup 'tests/**/*.test.js'",
14-
"test:watch": "mocha --require tests/config/setup 'tests/**/*.test.js' --watch",
15-
"test:cover": "istanbul cover -x *.test.js _mocha -- -R spec --require tests/config/setup 'tests/**/*.test.js'",
13+
"test": "ava",
14+
"test:watch": "ava --watch",
15+
"test:cover": "nyc ava",
1616
"test:report": "cat ./coverage/lcov.info | codecov && rm -rf ./coverage",
1717
"semantic-release": "semantic-release pre && npm publish && semantic-release post",
1818
"build": "npm run build:umd && npm run build:es && npm run build:cjs",
@@ -28,8 +28,11 @@
2828
},
2929
"license": "MIT",
3030
"devDependencies": {
31+
"ava": "^0.21.0",
3132
"babel-core": "^6.25.0",
32-
"chai": "^4.1.0",
33+
"babel-polyfill": "^6.23.0",
34+
"babel-preset-env": "^1.6.0",
35+
"babel-register": "^6.24.1",
3336
"codecov.io": "^0.1.6",
3437
"concurrently": "^3.5.0",
3538
"cz-conventional-changelog": "^2.0.0",
@@ -41,10 +44,9 @@
4144
"eslint-plugin-promise": "^3.5.0",
4245
"eslint-plugin-standard": "^3.0.1",
4346
"husky": "^0.14.3",
44-
"istanbul": "^1.1.0-alpha.1",
4547
"jsdom": "^9.12.0",
4648
"lint-staged": "^4.0.1",
47-
"mocha": "^3.4.2",
49+
"nyc": "^11.0.3",
4850
"pascal-case": "^2.0.1",
4951
"prettier-eslint-cli": "^4.1.1",
5052
"rollup": "^0.45.2",
@@ -69,5 +71,11 @@
6971
"git add"
7072
]
7173
},
72-
"homepage": "https://github.com/ritz078/javascript-plugin-boilerplate"
74+
"homepage": "https://github.com/ritz078/javascript-plugin-boilerplate",
75+
"ava": {
76+
"require": [
77+
"babel-register",
78+
"babel-polyfill"
79+
]
80+
}
7381
}

tests/index.test.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,6 @@
1+
import test from 'ava'
2+
import sum from '../src'
13

4+
test('Add', (t) => {
5+
t.is(sum(2,3), 5)
6+
})

0 commit comments

Comments
 (0)