Add coverage using nyc, badge to readme, and ignore the coverage outputs. (#50)

* First pass at mafintosh/dns-packet#48. No auto-refresh yet, because that's a more invasive change.

* Add a quick note to README to kick off a round of tests.

* remove sudo:false
This commit is contained in:
Joe Hildebrand 2019-02-27 15:31:44 -07:00 committed by silverwind
parent e7c072072d
commit 77eadae3c3
4 changed files with 20 additions and 3 deletions

5
.gitignore vendored
View File

@ -1 +1,4 @@
node_modules node_modules/
.nyc_output/
coverage/
package-lock.json

View File

@ -2,3 +2,10 @@ language: node_js
node_js: node_js:
- node - node
- lts/* - lts/*
install:
- npm install
- npm install coveralls
script:
- npm run coverage
after_success:
- npx nyc report --reporter=text-lcov | npx coveralls

View File

@ -1,5 +1,5 @@
# dns-packet # dns-packet
[![](https://img.shields.io/npm/v/dns-packet.svg?style=flat)](https://www.npmjs.org/package/dns-packet) [![](https://img.shields.io/npm/dm/dns-packet.svg)](https://www.npmjs.org/package/dns-packet) [![](https://api.travis-ci.org/mafintosh/dns-packet.svg?style=flat)](https://travis-ci.org/mafintosh/dns-packet) [![](https://img.shields.io/npm/v/dns-packet.svg?style=flat)](https://www.npmjs.org/package/dns-packet) [![](https://img.shields.io/npm/dm/dns-packet.svg)](https://www.npmjs.org/package/dns-packet) [![](https://api.travis-ci.org/mafintosh/dns-packet.svg?style=flat)](https://travis-ci.org/mafintosh/dns-packet) [![Coverage Status](https://coveralls.io/repos/github/mafintosh/dns-packet/badge.svg?branch=master)](https://coveralls.io/github/mafintosh/dns-packet?branch=master)
An [abstract-encoding](https://github.com/mafintosh/abstract-encoding) compliant module for encoding / decoding DNS packets. Lifted out of [multicast-dns](https://github.com/mafintosh/multicast-dns) as a separate module. An [abstract-encoding](https://github.com/mafintosh/abstract-encoding) compliant module for encoding / decoding DNS packets. Lifted out of [multicast-dns](https://github.com/mafintosh/multicast-dns) as a separate module.
@ -251,6 +251,8 @@ And an answer, additional, or authority looks like this
#### `OPT` #### `OPT`
[EDNS0](https://tools.ietf.org/html/rfc6891) options.
``` js ``` js
{ {
type: 'OPT', type: 'OPT',

View File

@ -10,7 +10,11 @@
"node": ">=6" "node": ">=6"
}, },
"scripts": { "scripts": {
"test": "eslint --color *.js examples/*.js && tape test.js" "clean": "rm -rf coverage .nyc_output/",
"lint": "eslint --color *.js examples/*.js",
"pretest": "npm run lint",
"test": "tape test.js",
"coverage": "nyc -r html npm test"
}, },
"dependencies": { "dependencies": {
"ip": "^1.1.5" "ip": "^1.1.5"
@ -22,6 +26,7 @@
"eslint-plugin-node": "^8.0.1", "eslint-plugin-node": "^8.0.1",
"eslint-plugin-promise": "^4.0.1", "eslint-plugin-promise": "^4.0.1",
"eslint-plugin-standard": "^4.0.0", "eslint-plugin-standard": "^4.0.0",
"nyc": "^13.3.0",
"tape": "^4.10.1" "tape": "^4.10.1"
}, },
"keywords": [ "keywords": [