From c352dd3efe9c18d4b6fad47ef782347503d1d56b Mon Sep 17 00:00:00 2001 From: alpersogukpinar Date: Mon, 16 Jan 2017 15:49:17 +0200 Subject: [PATCH 1/4] Update index.js nyc command line include parameter was ignored and package.json nyc/include values were used everytime. Fixed that problem. Fix #82 --- src/index.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/index.js b/src/index.js index 13b7de8..1952c58 100644 --- a/src/index.js +++ b/src/index.js @@ -19,9 +19,11 @@ function makeShouldSkip () { return function shouldSkip (file, opts) { if (!exclude) { const cwd = getRealpath(process.env.NYC_CWD || process.cwd()) + const config = JSON.parse(process.env.NYC_CONFIG) exclude = testExclude(assign( { cwd }, Object.keys(opts).length > 0 ? opts : { + include: config.include, configKey: 'nyc', configPath: dirname(findUp.sync('package.json', { cwd })) } From 151ed9e93134a8a106e8dd66623253c4fc49d6ec Mon Sep 17 00:00:00 2001 From: alpersogukpinar Date: Mon, 16 Jan 2017 17:08:14 +0200 Subject: [PATCH 2/4] NYC_CONFIG null check --- src/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/index.js b/src/index.js index 1952c58..ccffbd1 100644 --- a/src/index.js +++ b/src/index.js @@ -19,11 +19,11 @@ function makeShouldSkip () { return function shouldSkip (file, opts) { if (!exclude) { const cwd = getRealpath(process.env.NYC_CWD || process.cwd()) - const config = JSON.parse(process.env.NYC_CONFIG) + const include = process.env.NYC_CONFIG ? JSON.parse(process.env.NYC_CONFIG).include : undefined exclude = testExclude(assign( { cwd }, Object.keys(opts).length > 0 ? opts : { - include: config.include, + include: include, configKey: 'nyc', configPath: dirname(findUp.sync('package.json', { cwd })) } From 0020b378646b16e0217df2386a31e51782461b7a Mon Sep 17 00:00:00 2001 From: alpersogukpinar Date: Mon, 16 Jan 2017 17:33:54 +0200 Subject: [PATCH 3/4] nyc command line include parameter fix nyc command line include parameter was being ignored and package.json nyc/include values were being used everytime. Fixed that problem. Fix #82 --- src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index ccffbd1..2acc80b 100644 --- a/src/index.js +++ b/src/index.js @@ -19,7 +19,7 @@ function makeShouldSkip () { return function shouldSkip (file, opts) { if (!exclude) { const cwd = getRealpath(process.env.NYC_CWD || process.cwd()) - const include = process.env.NYC_CONFIG ? JSON.parse(process.env.NYC_CONFIG).include : undefined + const include = process.env.NYC_CONFIG ? JSON.parse(process.env.NYC_CONFIG).include : false exclude = testExclude(assign( { cwd }, Object.keys(opts).length > 0 ? opts : { From e55b6dc3736261e151a040d1ffd0e5bafc4e0ce3 Mon Sep 17 00:00:00 2001 From: alpersogukpinar Date: Mon, 16 Jan 2017 23:30:15 +0200 Subject: [PATCH 4/4] Update index.js --- src/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/index.js b/src/index.js index 2acc80b..4db1729 100644 --- a/src/index.js +++ b/src/index.js @@ -19,11 +19,11 @@ function makeShouldSkip () { return function shouldSkip (file, opts) { if (!exclude) { const cwd = getRealpath(process.env.NYC_CWD || process.cwd()) - const include = process.env.NYC_CONFIG ? JSON.parse(process.env.NYC_CONFIG).include : false + const defaults = process.env.NYC_CONFIG ? JSON.parse(process.env.NYC_CONFIG) : {} exclude = testExclude(assign( { cwd }, Object.keys(opts).length > 0 ? opts : { - include: include, + include: defaults.include, configKey: 'nyc', configPath: dirname(findUp.sync('package.json', { cwd })) }