Skip to content

Commit

Permalink
build(nyc): fix coverage report
Browse files Browse the repository at this point in the history
- get rid of mocha-webpack

Closes #52
  • Loading branch information
char0n committed Apr 4, 2017
1 parent 17cc387 commit 8f0b752
Show file tree
Hide file tree
Showing 50 changed files with 148 additions and 82 deletions.
5 changes: 4 additions & 1 deletion .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@
"es": {
},
"coverage": {
"plugins": [ "istanbul" ]
"plugins": [
["transform-es2015-modules-commonjs", { "loose": true }],
"istanbul"
]
}
}
}
12 changes: 7 additions & 5 deletions .nycrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
"lcov",
"text-summary"
],
"include": [
"src/**/*.js"
],
"report-dir": "./coverage",
"check-coverage": true,
"exclude": [
"webpack.config-test.node.js",
".tmp/**/*",
"test/**/*"
]
"all": true,
"cache": false,
"sourceMap": false,
"instrument": false
}
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@
"lint": "eslint ./",
"lint:fix": "eslint ./ --fix",
"changelog": "conventional-changelog -p angular -i ./CHANGELOG.md -s -r 0",
"test": "mocha-webpack --opts test/mocha-webpack.opts",
"test": "cross-env BABEL_ENV=commonjs mocha",
"test:web": "testem ci",
"test:bundle-create": "webpack --config webpack.config-test.web.js",
"test:bundle-clean": "rimraf tmp-test-bundle.js",
"coverage": "cross-env BABEL_ENV=coverage nyc npm test",
"coverage": "cross-env BABEL_ENV=coverage nyc mocha",
"build": "npm run build:es && npm run build:commonjs && npm run build:umd",
"build:es": "cross-env BABEL_ENV=es babel src --out-dir es",
"build:commonjs": "cross-env BABEL_ENV=commonjs babel src --out-dir lib",
Expand All @@ -68,6 +68,7 @@
"babel-preset-es2015": "=6.24.0",
"babel-preset-es2016": "=6.22.0",
"babel-preset-stage-3": "=6.22.0",
"babel-register": "=6.24.0",
"better-npm-run": "=0.0.14",
"chai": "=3.5.0",
"codecov": "=2.1.0",
Expand All @@ -85,7 +86,6 @@
"mocha": "=3.2.0",
"mocha-junit-reporter": "=1.13.0",
"mocha-multi-reporters": "=1.1.4",
"mocha-webpack": "=0.7.0",
"nsp": "=2.6.3",
"nyc": "=10.1.2",
"phantom": "=4.0.1",
Expand Down
4 changes: 3 additions & 1 deletion src/internal/isOfTypeObject.js
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
export default val => typeof val === 'object';
const isOfTypeObject = val => typeof val === 'object';

export default isOfTypeObject;
4 changes: 3 additions & 1 deletion src/internal/polyfills/Number.MAX_SAFE_INTEGER.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { or } from 'ramda';

export default or(Number.MAX_SAFE_INTEGER, (2 ** 53) - 1);
const MAX_SAFE_INTEGER = or(Number.MAX_SAFE_INTEGER, (2 ** 53) - 1);

export default MAX_SAFE_INTEGER;
4 changes: 3 additions & 1 deletion src/internal/polyfills/Number.MIN_SAFE_INTEGER.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { or } from 'ramda';

export default or(Number.MIN_SAFE_INTEGER, -(2 ** 53) - 1);
const MIN_SAFE_INTEGER = or(Number.MIN_SAFE_INTEGER, -(2 ** 53) - 1);

export default MIN_SAFE_INTEGER;
3 changes: 2 additions & 1 deletion src/internal/polyfills/Number.isFinite.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ import { both } from 'ramda';

import isNumber from '../../isNumber';

const isFinitePolyfill = both(isNumber, isFinite);

export default both(isNumber, isFinite);
export default isFinitePolyfill;
3 changes: 2 additions & 1 deletion src/internal/polyfills/Number.isInteger.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ import { both, converge, equals, identity } from 'ramda';

import isFinite from '../../isFinite';

const isIntegerPolyfill = both(isFinite, converge(equals, [Math.floor, identity]));

export default both(isFinite, converge(equals, [Math.floor, identity]));
export default isIntegerPolyfill;
3 changes: 2 additions & 1 deletion src/internal/polyfills/Number.isNaN.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ import { both } from 'ramda';

import isNumber from '../../isNumber';

const isNaNPolyfill = both(isNumber, isNaN);

export default both(isNumber, isNaN);
export default isNaNPolyfill;
4 changes: 3 additions & 1 deletion src/isArray.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,6 @@ import _isArray from 'ramda/src/internal/_isArray';
* RA.isArray(null); //=> false
* RA.isArray({}); //=> false
*/
export default _isArray;
const isArray = _isArray;

export default isArray;
3 changes: 2 additions & 1 deletion src/isAsyncFunction.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@
* RA.isAsyncFunction(() => {}); //=> false
*/
/* eslint-enable max-len */
const isAsyncFunction = val => Object.prototype.toString.call(val) === '[object AsyncFunction]';

export default val => Object.prototype.toString.call(val) === '[object AsyncFunction]';
export default isAsyncFunction;
4 changes: 3 additions & 1 deletion src/isBoolean.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,6 @@ import { is } from 'ramda';
* RA.isBoolean(true); //=> true
* RA.isBoolean(null); //=> false
*/
export default is(Boolean);
const isBoolean = is(Boolean);

export default isBoolean;
4 changes: 3 additions & 1 deletion src/isDate.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,6 @@ import { is } from 'ramda';
* RA.isDate(new Date()); //=> true
* RA.isDate('1997-07-16T19:20+01:00'); //=> false
*/
export default is(Date);
const isDate = is(Date);

export default isDate;
4 changes: 3 additions & 1 deletion src/isFinite.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,6 @@ import polyfill from './internal/polyfills/Number.isFinite';
* RA.isFinite(null); // => false
* // would've been true with global isFinite(null)
*/
export default or(Number.isFinite, polyfill);
const _isFinite = or(Number.isFinite, polyfill);

export default _isFinite;
4 changes: 3 additions & 1 deletion src/isFunction.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,6 @@ import isAsyncFunction from './isAsyncFunction';
* RA.isFunction('abc'); //=> false
*/
/* eslint-enable max-len */
export default anyPass([_isFunction, isGeneratorFunction, isAsyncFunction]);
const isFunction = anyPass([_isFunction, isGeneratorFunction, isAsyncFunction]);

export default isFunction;
4 changes: 3 additions & 1 deletion src/isGeneratorFunction.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,11 @@ try {
* RA.isGeneratorFunction(() => {}); //=> false
*/
/* eslint-enable max-len */
export default (val) => {
const isGeneratorFunction = (val) => {
const toStringCheck = Object.prototype.toString.call(val) === '[object AsyncFunction]';
const legacyConstructorCheck = isNotNull(GeneratorFunction) && val instanceof GeneratorFunction;

return or(toStringCheck, legacyConstructorCheck);
};

export default isGeneratorFunction;
4 changes: 3 additions & 1 deletion src/isInterger.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,6 @@ import polyfill from './internal/polyfills/Number.isInteger';
* RA.isInteger(false); //=> false
* RA.isInteger([1]); //=> false
*/
export default or(Number.isInteger, polyfill);
const isInteger = or(Number.isInteger, polyfill);

export default isInteger;
4 changes: 3 additions & 1 deletion src/isNaN.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,6 @@ import polyfill from './internal/polyfills/Number.isNaN';
* RA.isNaN(''); // => false
* RA.isNaN(' '); // => false
*/
export default or(Number.isNaN, polyfill);
const _isNaN = or(Number.isNaN, polyfill);

export default _isNaN;
4 changes: 3 additions & 1 deletion src/isNilOrEmpty.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,6 @@ import { anyPass, isEmpty, isNil } from 'ramda';
* RA.isNilOrEmpty({}); //=> true
* RA.isNilOrEmpty({length: 0}); //=> false
*/
export default anyPass([isNil, isEmpty]);
const isNilOrEmpty = anyPass([isNil, isEmpty]);

export default isNilOrEmpty;
4 changes: 3 additions & 1 deletion src/isNotArray.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,6 @@ import isArray from './isArray';
* RA.isNotArray(null); //=> true
* RA.isNotArray({}); //=> true
*/
export default complement(isArray);
const isNotArray = complement(isArray);

export default isNotArray;
4 changes: 3 additions & 1 deletion src/isNotArrayLike.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,6 @@ import { complement, isArrayLike } from 'ramda';
* RA.isNotArrayLike({length: 10}); //=> true
* RA.isNotArrayLike({0: 'zero', 9: 'nine', length: 10}); //=> false
*/
export default complement(isArrayLike);
const isNotArrayLike = complement(isArrayLike);

export default isNotArrayLike;
4 changes: 3 additions & 1 deletion src/isNotAsyncFunction.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,6 @@ import isAsyncFunction from './isAsyncFunction';
* RA.isNotAsyncFunction(() => {}); //=> true
*/
/* eslint-enable max-len */
export default complement(isAsyncFunction);
const isNotAsyncFunction = complement(isAsyncFunction);

export default isNotAsyncFunction;
4 changes: 3 additions & 1 deletion src/isNotBoolean.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,6 @@ import isBoolean from './isBoolean';
* RA.isNotBoolean(true); //=> false
* RA.isNotBoolean(null); //=> true
*/
export default complement(isBoolean);
const isNotBoolean = complement(isBoolean);

export default isNotBoolean;
4 changes: 3 additions & 1 deletion src/isNotDate.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,6 @@ import isDate from './isDate';
* RA.isNotDate(new Date()); //=> false
* RA.isNotDate('1997-07-16T19:20+01:00'); //=> true
*/
export default complement(isDate);
const isNotDate = complement(isDate);

export default isNotDate;
4 changes: 3 additions & 1 deletion src/isNotEmpty.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,6 @@ import { complement, isEmpty } from 'ramda';
* RA.isNotEmpty({}); //=> false
* RA.isNotEmpty({length: 0}); //=> true
*/
export default complement(isEmpty);
const isNotEmpty = complement(isEmpty);

export default isNotEmpty;
4 changes: 3 additions & 1 deletion src/isNotFinite.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,6 @@ import _isFinite from './isFinite';
* RA.isNotFinite('0'); // => true
* RA.isNotFinite(null); // => true
*/
export default complement(_isFinite);
const isNotFinite = complement(_isFinite);

export default isNotFinite;
4 changes: 3 additions & 1 deletion src/isNotFunction.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,6 @@ import isFunction from './isFunction';
* RA.isNotFunction('abc'); //=> true
*/
/* eslint-enable max-len */
export default complement(isFunction);
const isNotFunction = complement(isFunction);

export default isNotFunction;
4 changes: 3 additions & 1 deletion src/isNotGeneratorFunction.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,6 @@ import isGeneratorFunction from './isGeneratorFunction';
* RA.isNotGeneratorFunction(() => {}); //=> true
*/
/* eslint-enable max-len */
export default complement(isGeneratorFunction);
const isNotGeneratorFunction = complement(isGeneratorFunction);

export default isNotGeneratorFunction;
4 changes: 3 additions & 1 deletion src/isNotInteger.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,6 @@ import isInteger from './isInterger';
* RA.isNotInteger(false); //=> true
* RA.isNotInteger([1]); //=> true
*/
export default complement(isInteger);
const isNotInteger = complement(isInteger);

export default isNotInteger;
6 changes: 4 additions & 2 deletions src/isNotNaN.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { complement } from 'ramda';

import isNaN from './isNaN';
import _isNaN from './isNaN';

/**
* Checks whether the passed value is complement of `NaN` and its type is not `Number`.
Expand Down Expand Up @@ -32,4 +32,6 @@ import isNaN from './isNaN';
* RA.isNotNaN(''); // => true
* RA.isNotNaN(' '); // => true
*/
export default complement(isNaN);
const isNotNaN = complement(_isNaN);

export default isNotNaN;
4 changes: 3 additions & 1 deletion src/isNotNil.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,6 @@ import { isNil, complement } from 'ramda';
* RA.isNotNil(0); //=> true
* RA.isNotNil([]); //=> true
*/
export default complement(isNil);
const isNotNil = complement(isNil);

export default isNotNil;
4 changes: 3 additions & 1 deletion src/isNotNull.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,6 @@ import isNull from './isNull';
* RA.isNotNull(undefined); //=> true
* RA.isNotNull(null); //=> false
*/
export default complement(isNull);
const isNotNull = complement(isNull);

export default isNotNull;
4 changes: 3 additions & 1 deletion src/isNotNumber.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,6 @@ import isNumber from './isNumber';
* RA.isNotNumber(-Infinity); // => false
* RA.isNotNumber('5'); // => true
*/
export default complement(isNumber);
const isNotNumber = complement(isNumber);

export default isNotNumber;
4 changes: 3 additions & 1 deletion src/isNotObject.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,6 @@ import isObject from './isObject';
* RA.isNotObject(undefined); //=> true
*/
/* eslint-enable max-len */
export default complement(isObject);
const isNotObject = complement(isObject);

export default isNotObject;
4 changes: 3 additions & 1 deletion src/isNotObjectLike.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,6 @@ import isObjectLike from './isObjectLike';
* RA.isNotObjectLike(undefined); //=> true
*/
/* eslint-enable max-len */
export default complement(isObjectLike);
const isNotObjectLike = complement(isObjectLike);

export default isNotObjectLike;
4 changes: 3 additions & 1 deletion src/isNotPlainObject.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,6 @@ import isPlainObject from './isPlainObject';
* RA.isNotPlainObject(new Object()); //=> false
*/
/* eslint-enable max-len */
export default complement(isPlainObject);
const isNotPlainObject = complement(isPlainObject);

export default isNotPlainObject;
4 changes: 3 additions & 1 deletion src/isNotString.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,6 @@ import isString from './isString';
* RA.isNotString('abc'); //=> false
* RA.isNotString(1); //=> true
*/
export default complement(isString);
const isNotString = complement(isString);

export default isNotString;
4 changes: 3 additions & 1 deletion src/isNotUndefined.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,6 @@ import isUndefined from './isUndefined';
* RA.isNotUndefined(undefined); //=> false
* RA.isNotUndefined(null); //=> true
*/
export default complement(isUndefined);
const isNotUndefined = complement(isUndefined);

export default isNotUndefined;
4 changes: 3 additions & 1 deletion src/isNull.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,6 @@ import { equals } from 'ramda';
* RA.isNull(undefined); //=> false
* RA.isNull(null); //=> true
*/
export default equals(null);
const isNull = equals(null);

export default isNull;
4 changes: 3 additions & 1 deletion src/isNumber.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,6 @@ import _isNumber from 'ramda/src/internal/_isNumber';
* RA.isNumber(-Infinity); // => true
* RA.isNumber('5'); // => false
*/
export default _isNumber;
const isNumber = _isNumber;

export default isNumber;
4 changes: 3 additions & 1 deletion src/isObject.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,6 @@ import isOfTypeObject from './internal/isOfTypeObject';
* RA.isObject(undefined); //=> false
*/
/* eslint-enable max-len */
export default both(isNotNull, anyPass([isOfTypeObject, isFunction]));
const isObject = both(isNotNull, anyPass([isOfTypeObject, isFunction]));

export default isObject;
4 changes: 3 additions & 1 deletion src/isObjectLike.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,6 @@ import isOfTypeObject from './internal/isOfTypeObject';
* RA.isObjectLike(undefined); //=> false
*/
/* eslint-enable max-len */
export default both(isNotNull, isOfTypeObject);
const isObjectLike = both(isNotNull, isOfTypeObject);

export default isObjectLike;
4 changes: 3 additions & 1 deletion src/isPlainObject.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const hasObjectConstructor = pathSatisfies(both(isFunction, isObjectConstructor)
* RA.isPlainObject(new Object()); //=> true
*/
/* eslint-enable max-len */
export default (val) => {
const isPlainObject = (val) => {
if (!isObjectLike(val) || !_isObject(val)) { return false }

const proto = Object.getPrototypeOf(val);
Expand All @@ -45,3 +45,5 @@ export default (val) => {

return hasObjectConstructor(proto);
};

export default isPlainObject;
Loading

0 comments on commit 8f0b752

Please sign in to comment.