Skip to content

Commit

Permalink
Adjusting code-coverage
Browse files Browse the repository at this point in the history
For which installed isparta and re-configured package.json for it to run
whatever it needs
  • Loading branch information
karudedios committed Oct 20, 2015
1 parent 695bb41 commit d38b605
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 17 deletions.
2 changes: 2 additions & 0 deletions lib/Default.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export default (() => {
function compose(...funcs) {
if (!funcs.length) throw "Must specify functions to compose";
if (funcs.some((x) => !(x instanceof Function))) throw "Functions only allowed";

return funcs.reduce((composed, toCompose) => ((...args) => toCompose(composed(...args))), funcs.shift());
}

Expand All @@ -29,6 +30,7 @@ export default (() => {

Object.defineProperty(fn, 'arity', { value: (fn.arity || fn.length), writable: true });
Object.defineProperty(curried, 'arity', { value: fn.arity, writable: true });

return curried;
}

Expand Down
11 changes: 8 additions & 3 deletions lib/Identity.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
"use strict";

export default {
Identity(v) { return v; }
};
export default (() => {
let Identity = (v) => v;

return {
id: Identity,
Identity
};
})();
17 changes: 13 additions & 4 deletions lib/Validator.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,22 @@ export default (() => {
}

where(predicate) {
return predicate(this.value) ? Validator.valid(this.value) : Validator.invalid(this.value);
return predicate(this.value)
? Validator.valid(this.value)
: Validator.invalid(this.value);
}

static from(v) { return new Validator(v); }
static from(v) {
return new Validator(v);
}

static valid(v) {
return new Valid(v);
}

static valid(v) { return new Valid(v); }
static invalid(v) { return new Invalid(v); }
static invalid(v) {
return new Invalid(v);
}
}

class Valid extends Validator {
Expand Down
18 changes: 8 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,17 @@
"description": " Holder of various Functional Programming utilities",
"main": "compiled/dist/FunctionalProgrammingUtilities.js",
"scripts": {
"test": "mocha --compilers js:babel/register spec/",
"cover": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --compilers js:babel/register --colors --reporter spec spec/",
"cover-es6": " node --harmony node_modules/istanbul-harmony/lib/cli.js cover --print both --hook-run-in-context node_modules/mocha/bin/_mocha -- -R spec --U exports --compilers js:babel/register spec/",
"lint": "npm run lint:lib && npm run lint:src&& npm run lint:spec",
"lint:spec": "jshint spec/",
"test": "mocha --compilers js:babel/register --colors --reporter spec",
"cover": "babel-node node_modules/isparta/bin/isparta cover node_modules/mocha/bin/_mocha --report lcovonly -- --colors --reporter spec",
"lint": "npm run lint:lib && npm run lint:src&& npm run lint:test",
"lint:lib": "jshint lib/",
"lint:src": "jshint src/",
"compile": "npm run compile:libs && npm run compile:src",
"lint:test": "jshint test/",
"compile": "npm run compile:lib && npm run compile:src",
"compile:lib": "babel -d compiled/lib/ lib/",
"compile:src": "babel -d compiled/dist/ src/",
"compile:libs": "babel -d compiled/lib/ lib/",
"prepublish": "npm run compile",
"build": "npm run lint && npm run test && npm run cover-es6",
"build": "npm run lint && npm run test && npm run cover",
"post-build": "rm -rf coverage/"
},
"repository": {
Expand All @@ -36,8 +35,7 @@
"devDependencies": {
"babel": "^5.8.23",
"coveralls": "^2.11.4",
"istanbul": "^0.4.0",
"istanbul-harmony": "^0.3.16",
"isparta": "^3.1.0",
"jshint": "^2.8.0",
"mocha": "^2.3.3"
}
Expand Down

0 comments on commit d38b605

Please sign in to comment.