Join 500+ Software Testing professionals. Solve problem and get your problem solved. Register Now!

Error: cannot resolve path (or pattern) 'true' - grunt-loop-mocha

Open 1 Answers 30 Views
0 1

I have setup grunt-loop-mocha. I am getting below error while executing tests:


Reading C:\Users\@@@@\Documents\oa-automation-suite\oa-automation-suite\node
Parsing C:\Users\@@@@\Documents\oa-automation-suite\oa-automation-suite\node
Loading "loop-mocha.js" tasks...OK
+ loopmocha
Loading "process-loop.js" tasks...OK
>> No tasks were registered or unregistered.
Loading "Gruntfile.js" tasks...OK
+ test

Running tasks: test

Running "test" task

Running "loopmocha" task

Running "loopmocha:src" (loopmocha) task
Verifying property loopmocha.src exists in config...OK
Files: ./test/[email protected]@@@_Wrapper-specs.js -> src
Options: mocha={"reporter":"spec","timeout_ms":30000,"ignoreLeaks":false,"logErr
ors":true,"fullTrace":true,"bail":true,"grep":".*"}, iterations=[{"description":
"Executing tests on Chrome","DESIRED":"{\"browserName\": \"chrome\"}"}]
adding key DESIRED value {"browserName": "chrome"}
[grunt-loop-mocha] setting ENV var  DESIRED with value {"browserName": "chrome"}

loopOptions {}
[grunt-loop-mocha] iteration:  1500093389564-Executing tests on Chrome
[grunt-loop-mocha] mocha argv:  --reporter,spec,--timeout_ms,30000,--ignoreLeaks
,--logErrors,true,--fullTrace,true,--bail,true,--grep,.*,./test/[email protected]@@@_W
        throw new Error("cannot resolve path (or pattern) '" + path + "'");

Error: cannot resolve path (or pattern) 'true'
    at Object.lookupFiles (C:\Users\@@@@\Documents\oa-automation-suite\oa-au
    at C:\Users\@@@@\Documents\oa-automation-suite\oa-automation-suite\node_
    at Array.forEach (native)
    at Object.<anonymous> (C:\Users\@@@@\Documents\oa-automation-suite\oa-au
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.runMain (module.js:604:10)
    at run (bootstrap_node.js:389:7)
    at startup (bootstrap_node.js:149:9)
    at bootstrap_node.js:504:3
[grunt-loop-mocha] Total Runtime 0s
Warning: [grunt-loop-mocha] error, please check erroneous iteration(s):
    "1500093389564-Executing tests on Chrome": 1
 Use --force to continue.

Aborted due to warnings.


Here is my grunt file content:

module.exports = function(grunt) {

        loopmocha: {
            src: ["./test/*-specs.js"],
            options: {
                mocha: {
                    reporter : 'spec',
                    timeout_ms : 30000,
                    ignoreLeaks : false,
                    logErrors : true,
                    fullTrace : true,
                    bail : true,
                    grep : ".*"
                //loop: {
                //    reportLocation: "test/report"
                iterations: [
                        "description": "Executing tests on Chrome",
                        "DESIRED": '{"browserName": "chrome"}'
	grunt.registerTask('test', 'loopmocha');


1 Answer


It looks like loopmocha does not have below mocha options.

Removing below options did the trick.

ignoreLeaks : false,
logErrors : true,
fullTrace : true,
bail : true,
grep : ".*"
answered by (151 points)

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please log in or register.