Skip to content

Commit

Permalink
☂ Setup code coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
screendriver committed Oct 31, 2018
1 parent b4b5354 commit d5cb344
Show file tree
Hide file tree
Showing 8 changed files with 1,044 additions and 16 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
.nyc_output
coverage
node_modules
dist
11 changes: 11 additions & 0 deletions .nycrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"exclude": [
"**/*.test.*",
"dist/test/integration"
],
"reporter": [
"lcov",
"json",
"text-summary"
]
}
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ script:
- yarn clean
- yarn build
- yarn test
- codecov -f coverage/*.json
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,14 @@
"clean": "rm -rf dist",
"lint": "tslint -c tslint.json 'src/**/*.ts' 'test/**/*.ts'",
"test:unit": "tape -r source-map-support/register 'dist/test/unit/**/*.js' | tap-spec",
"test": "yarn lint && yarn test:unit",
"test": "yarn lint && nyc yarn test:unit",
"build": "tsc"
},
"devDependencies": {
"@types/tape": "4.2.32",
"codecov": "3.1.0",
"husky": "1.1.2",
"nyc": "13.1.0",
"prettier": "1.14.3",
"pretty-quick": "1.8.0",
"source-map-support": "0.5.9",
Expand Down
3 changes: 3 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export function testMe() {
return 123;
}
5 changes: 3 additions & 2 deletions test/unit/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import test from 'tape';
import { testMe } from '../../src/index';

test('should work', t => {
t.pass();
t.end();
t.plan(1);
t.is(testMe(), 123);
});
4 changes: 2 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

{
"compilerOptions": {
"target": "es2015",
Expand All @@ -8,6 +7,7 @@
"outDir": "./dist",
"noEmitOnError": true,
"importHelpers": true,
"sourceMap": true,
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
Expand All @@ -19,4 +19,4 @@
},
"include": ["src/**/*", "test/**/*"],
"exclude": ["node_modules"]
}
}
Loading

0 comments on commit d5cb344

Please sign in to comment.