From f0411d01d3edd1cb420c0789183622e5fb20cea3 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Sat, 6 Jun 2020 03:53:59 +0300 Subject: [PATCH] experimenting with code coverage... Signed-off-by: Alex A. Naanou --- .gitignore | 2 ++ .npmignore | 2 ++ package.json | 5 ++++- test.js | 24 ++++++++++++------------ 4 files changed, 20 insertions(+), 13 deletions(-) diff --git a/.gitignore b/.gitignore index 1e32d53..e71a333 100755 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,6 @@ *.vim *.sw[po] .git +coverage +node_modules npm-debug.log diff --git a/.npmignore b/.npmignore index ed9af7a..5d2f460 100755 --- a/.npmignore +++ b/.npmignore @@ -3,4 +3,6 @@ *.sw[po] .git .github +coverage +node_modules npm-debug.log diff --git a/package.json b/package.json index 926818a..c73b9d7 100755 --- a/package.json +++ b/package.json @@ -5,6 +5,8 @@ "main": "object.js", "scripts": { "test": "node ./test.js", + "cover-lcov": "c8 -r lcov node ./test.js", + "cover": "c8 node ./test.js", "prepublishOnly": "npm test" }, "repository": { @@ -24,6 +26,7 @@ }, "homepage": "https://github.com/flynx/object.js#readme", "devDependencies": { - "colors": "^1.4.0" + "colors": "^1.4.0", + "c8": "*" } } diff --git a/test.js b/test.js index 98a1709..4fbfe91 100755 --- a/test.js +++ b/test.js @@ -767,7 +767,7 @@ if(typeof(__filename) != 'undefined' Each of the items in the test spec can be a "*" indicating that all relevant items should be used, for example: - ${ '$ ./$scriptname basic:*:*'.gray } + ${ '$ ./$scriptname basic:*:*' } Here $scriptname is instructed to run all tests and modifiers only on the basic setup. @@ -777,17 +777,17 @@ if(typeof(__filename) != 'undefined' When no tests specified $scriptname will run all tests. `), __examples__: [ - ['$ ./$scriptname'.gray, - 'run all tests.'], - ['$ ./$scriptname basic:*:*'.gray, - 'run all tests and modifiers on "basic" setup.', - '(see '+ '$scriptname -l'.gray +' for more info)'], - ['$ ./$scriptname -v example'.gray, - 'run "example" test in verbose mode.'], - ['$ ./$scriptname native:gen3:methods init:gen3:methods'.gray, - 'run two tests/patterns.'], - ['$ export VERBOSE=1 && ./$scriptname'.gray, - 'set verbose mode globally and run tests.'], + ['$ ./$scriptname', + 'run all tests.'.gray], + ['$ ./$scriptname basic:*:*', + 'run all tests and modifiers on "basic" setup.'.gray, + '(see $scriptname -l for more info)'.gray], + ['$ ./$scriptname -v example', + 'run "example" test in verbose mode.'.gray], + ['$ ./$scriptname native:gen3:methods init:gen3:methods', + 'run two tests/patterns.'.gray], + ['$ export VERBOSE=1 && ./$scriptname', + 'set verbose mode globally and run tests.'.gray], ], // options... l: 'list',