Skip to content

Commit

Permalink
Add coverage reporting (#4)
Browse files Browse the repository at this point in the history
* Add tests coverage reporting
* Add badges
  • Loading branch information
ogonkov authored Dec 19, 2019
1 parent 80094bd commit 81d40c2
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,5 @@ typings/

# Compiled module
/es/

/test/.coverage/
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@ language: node_js

node_js:
- "lts/*"

script:
- npm test -- --coverage --collectCoverageFrom='src/**/*.js' --coverageReporters=text-lcov | coveralls
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
[![npm package][npm-image]][npm-url]
[![Coverage Status][coverage-image]][coverage-url]
[![node][node]][node-url]
[![Build Status][travis-image]][travis-url]
[![Dependencies Status][david-image]][david-url]

# Fest templates loader for Webpack
This Webpack loader compiles [Fest](https://github.com/mailru/fest) templates.

Expand Down Expand Up @@ -37,3 +43,14 @@ module.exports = {
|:--:|:--:|:-----:|:----------|
|**`beautify`**|`{Boolean}`|`true`|Beautify compiled template|
|**`module`**|`{String}`|`es`|Compiled template module type. `es` or `cjs`.|

[npm-image]:https://img.shields.io/npm/v/fest-webpack-loader.svg
[npm-url]:http://npmjs.org/package/fest-webpack-loader
[coverage-image]:https://coveralls.io/repos/github/ogonkov/fest-webpack-loader/badge.svg?branch=master
[coverage-url]:https://coveralls.io/github/ogonkov/fest-webpack-loader?branch=master
[node]: https://img.shields.io/node/v/fest-webpack-loader.svg
[node-url]: https://nodejs.org
[travis-image]:https://travis-ci.org/ogonkov/fest-webpack-loader.svg?branch=master
[travis-url]:https://travis-ci.org/ogonkov/fest-webpack-loader
[david-image]:https://david-dm.org/ogonkov/fest-webpack-loader/status.svg
[david-url]:https://david-dm.org/ogonkov/fest-webpack-loader
3 changes: 2 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
module.exports = {
testEnvironment: 'node'
testEnvironment: 'node',
coverageDirectory: 'test/.coverage'
};
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"@babel/core": "^7.5.5",
"@babel/preset-env": "^7.5.5",
"babel-jest": "^24.8.0",
"coveralls": "^3.0.9",
"eslint": "^6.0.1",
"fest": "^0.12.1",
"jest": "^24.8.0",
Expand All @@ -25,7 +26,7 @@
"node": ">= 8.9.0"
},
"scripts": {
"pretest": "eslint src",
"pretest": "rm -rf test/.coverage && eslint src",
"test": "jest",
"build": "babel src --out-dir=es",
"preversion": "npm test",
Expand Down

0 comments on commit 81d40c2

Please sign in to comment.