Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

re #16 add coverage tests #17

Merged
merged 2 commits into from
Oct 5, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@
._*
node_modules
npm-debug.log
index-cov.js
coverage.html
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ language: node_js
node_js:
- "0.10"
- "0.12"
after_success:
- npm run coveralls
8 changes: 7 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
"description": "Pretty simple mocks for the CRUD and REST API",
"main": "index.js",
"scripts": {
"test": "mocha"
"test": "mocha",
"make-cov": "jscoverage index.js index-cov.js",
"cov": "npm run make-cov; SM_COV=1 mocha -R html-cov > coverage.html",
"coveralls": "npm run make-cov; SM_COV=1 mocha -R mocha-lcov-reporter | coveralls"
},
"repository": {
"type": "git",
Expand All @@ -25,7 +28,10 @@
},
"homepage": "https://github.com/shuvalov-anton/superagent-mocker",
"devDependencies": {
"coveralls": "^2.11.4",
"jscoverage": "^0.6.0",
"mocha": "^2.2.4",
"mocha-lcov-reporter": "^1.0.0",
"should": "^6.0.1",
"superagent": "^1.2.0"
},
Expand Down
1 change: 1 addition & 0 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# superagent-mocker

[![Build Status](https://travis-ci.org/shuvalov-anton/superagent-mocker.svg?branch=master)](https://travis-ci.org/shuvalov-anton/superagent-mocker)
[![Coverage Status](https://coveralls.io/repos/shuvalov-anton/superagent-mocker/badge.svg?branch=master&service=github)](https://coveralls.io/github/shuvalov-anton/superagent-mocker?branch=master)

REST API mocker for the browsers. LOOK MA NO BACKEND! 👐

Expand Down
13 changes: 11 additions & 2 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@
* Dependencies
*/
var request = require('superagent');
var mock = require('./')(request);
var should = require('should');
var noop = function() {};
var mock = process.env.SM_COV
? require('./index-cov')(request)
: require('./index')(request);


describe('superagent mock', function() {

Expand Down Expand Up @@ -198,3 +200,10 @@ describe('superagent mock', function() {
});

});



/**
* Just noop
*/
function noop() {};