o2r-project / erc-checker

JavaScript library and CLI tool for ERC validation and comparison result checking
https://o2r.info/erc-checker/
Apache License 2.0
0 stars 4 forks source link

quite configuration is broken #5

Closed nuest closed 7 years ago

nuest commented 7 years ago

With quiet: true, I get the following error:

message:"debug is not a function"
stack:"TypeError: debug is not a function\n    at /home/daniel/git/o2r/o2r-muncher/node_modules/erc-checker/index.js:374:4\n    at Promise (<anonymous>)\n    at ercChecker (/home/daniel/git/o2r/o2r-muncher/node_modules/erc-checker/index.js:212:9)\n    at __dirname.Executor.compendium.check.Promise.updateStep (/home/daniel/git/o2r/o2r-muncher/lib/executor.js:743:11)\n    at __dirname.Executor.compendium.updateStep.Job.update (/home/daniel/git/o2r/o2r-muncher/lib/executor.js:115:7)\n    at Model.compile.model.Query.callback (/home/daniel/git/o2r/o2r-muncher/node_modules/mongoose/lib/query.js:2880:9)\n    at /home/daniel/git/o2r/o2r-muncher/node_modules/kareem/index.js:273:21\n    at /home/daniel/git/o2r/o2r-muncher/node_modules/kareem/index.js:131:16\n    at _combinedTickCallback (internal/process/next_tick.js:131:7)\n    at process._tickCallback (internal/process/next_tick.js:180:9)"
_

Triggered in line 374 in index.js.

I recommend instead of

if (quiet) {
        debug = debugERROR = null;
    }

simply the enabled property as described here: https://www.npmjs.com/package/debug#checking-whether-a-debug-target-is-enabled

if (quiet) {
        debug.enabled = false;
        debugERROR.enabled = false;
    }
Timmimim commented 7 years ago

Fixed in latest commit, PR #7