Permalink
Browse files

Add test coverage to the build (#48)

  • Loading branch information...
1 parent 91da1b1 commit 4e1001f81035f64b3033b87aec42e217638e167d @yurishkuro yurishkuro committed on GitHub Aug 22, 2016
Showing with 21 additions and 1 deletion.
  1. +1 −0 .gitignore
  2. +1 −0 .travis.yml
  3. +9 −0 README.md
  4. +10 −1 package.json
View
@@ -1,3 +1,4 @@
node_modules/
npm-debug.log
dist/*
+coverage/*
View
@@ -1,3 +1,4 @@
language: node_js
node_js:
- 0.12
+after_script: "cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js"
View
@@ -1,3 +1,5 @@
+[![Build Status][ci-img]][ci] [![Coverage Status][cov-img]][cov]
+
# OpenTracing API for JavaScript
This library is a JavaScript implementation of Open Tracing API. It is intended for use both on the server and in the browser.
@@ -108,3 +110,10 @@ The API layer uses a [bridge pattern](https://en.wikipedia.org/wiki/Bridge_patte
The "implementation API" - i.e. the interface the API layer expects to be able to call on the implementation - is a proper subset of the API layer itself. The surface area of the implementation API has been reduced in the case where the an API layer method (usually a convenience method of some form) can be expressed in terms of another more general method. For example, `logEvent` can be expressed as a `log` call, therefore the implementation only needs to implement `log`.
For truly implementation-dependent methods, the JavaScript API layer *does* expose `imp()` methods on each major type to allow the implementations to be accessed directly. Use of implementation-dependent methods is discouraged as it immediately makes instrumented code no longer portable. However, the `imp()` call does at least call attention to deviations from the standard API without making implementation-dependent calls impossible.
+
+
+ [ci-img]: https://travis-ci.org/opentracing/opentracing-javascript.svg?branch=master
+ [cov-img]: https://coveralls.io/repos/github/opentracing/opentracing-javascript/badge.svg?branch=master
+ [ci]: https://travis-ci.org/opentracing/opentracing-javascript
+ [cov]: https://coveralls.io/github/opentracing/opentracing-javascript?branch=master
+
View
@@ -1,10 +1,17 @@
{
"name": "opentracing",
"version": "0.11.1",
+ "licenses": [{
+ "type": "MIT",
+ "url": "https://opensource.org/licenses/MIT"
+ }],
"main": "dist/opentracing-node.js",
"scripts": {
"prepublish": "npm run webpack",
- "test": "node node_modules/mocha/bin/mocha -c test/unittest.js --check-leaks",
+ "test": "npm run test-cover",
+ "cover": "npm run test-cover && istanbul check-coverage",
+ "test-cover": "istanbul cover --report lcovonly --print none ./node_modules/.bin/_mocha test/unittest.js -- --check-leaks --color && istanbul report text",
+ "cover-html": "istanbul cover --report html --print none ./node_modules/.bin/_mocha test/unittest.js -- --check-leaks --color && istanbul report text",
"webpack": "npm run webpack-node-debug && npm run webpack-node-prod && npm run webpack-browser-debug && npm run webpack-browser-prod",
"webpack-node-debug": "BUILD_PLATFORM=node BUILD_CONFIG=debug webpack --display-error-details",
"webpack-node-prod": "BUILD_PLATFORM=node BUILD_CONFIG=prod webpack --display-error-details",
@@ -41,11 +48,13 @@
"chai": "^3.4.1",
"clone": "^1.0.2",
"colors": "^1.1.2",
+ "coveralls": "^2.11.12",
"eslint": "2.13.1",
"eslint-config-airbnb": "^9.0.1",
"eslint-plugin-import": "^1.10.2",
"eslint-plugin-jsx-a11y": "^1.5.5",
"eslint-plugin-react": "^5.2.2",
+ "istanbul": "^0.4.5",
"json-loader": "^0.5.4",
"mocha": "^2.4.5",
"shelljs": "^0.5.3",

0 comments on commit 4e1001f

Please sign in to comment.