Skip to content

Commit 983d6d5

Browse files
committed
Add coverage test and publish step to travis
1 parent 5ef6632 commit 983d6d5

File tree

4 files changed

+15
-7
lines changed

4 files changed

+15
-7
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
node_modules
22
/npm-*
33
/dist
4-
4+
.coverage
55
.directory
66
.DS_STORE*
77
*.log

.travis.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,20 @@
11
language: node_js
2+
node_js: ["6"]
23

3-
node_js:
4-
- "6"
4+
before_install:
5+
- echo "//registry.npmjs.org/:_authToken=\${NPM_TOKEN}" > .npmrc
56

67
install:
78
- yarn install
89

910
script:
1011
- yarn lint
1112
- yarn build
12-
- yarn test
13+
- DEBUG=true yarn test:coverage
14+
15+
deploy:
16+
provider: script
17+
script:
18+
- npm run release
19+
on:
20+
tags: true

jest.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ module.exports = {
33
"transform": { ".(ts|tsx)": "<rootDir>/node_modules/ts-jest/preprocessor.js" },
44
"testRegex": "(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$",
55
"moduleFileExtensions": [ "ts", "tsx", "js" ],
6+
"coverageDirectory": ".coverage",
67
"testPathIgnorePatterns": [
78
"/node_modules/",
89
"d.ts"

package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,9 @@
1313
"dist"
1414
],
1515
"scripts": {
16-
"test": "yarn test:unit",
17-
"test:unit": "jest",
16+
"test": "jest",
17+
"test:coverage": "jest --coverage",
1818
"lint": "tslint 'src/**/*.ts'",
19-
"test:watch": "jest -t '/[^/.]+\\.test' --watch",
2019
"release": "cd dist && npm publish",
2120
"build": "scripts/build.bash"
2221
},

0 commit comments

Comments
 (0)