Checkout our demo site to practice selenium https://magento.softwaretestingboard.com/

0 like 0 dislike
836 views
by Expert (572 points)
edited by

I am executing a test which is written using Node.js, Mocha and chai.

When I run the command npm test, I am getting below exeption.

C:\Users\mail_000\Documents\oa-automation-suite\oa-automation-suite>npm test

> [email protected] test C:\Users\mail_000\Documents\oa-automation-suite\
oa-automation-suite
> mocha

C:\Users\mail_000\AppData\Roaming\npm\node_modules\mocha\lib\utils.js:624
        throw new Error("cannot resolve path (or pattern) '" + path + "'");
        ^

Error: cannot resolve path (or pattern) 'test'
    at Object.lookupFiles (C:\Users\mail_000\AppData\Roaming\npm\node_modules\mo
cha\lib\utils.js:624:15)
    at C:\Users\mail_000\AppData\Roaming\npm\node_modules\mocha\bin\_mocha:324:3
0
    at Array.forEach (native)
    at Object.<anonymous> (C:\Users\mail_000\AppData\Roaming\npm\node_modules\mo
cha\bin\_mocha:323:6)
    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
npm ERR! Test failed.  See above for more details.

Kindly advice.

1 Answer

0 like 0 dislike
by

you need to add folder "test" in the project folder. And your test files in that test folder

 

E.G.
 /home/you/project/folder
  ├── lib
  ├── makefile
  ├── node_modules
  ├── package.json
  └── test
       ├── db.test.js

 


This site is for software testing professionals, where you can ask all your questions and get answers from 1300+ masters of the profession. Click here to submit yours now!

1.4k questions

1.6k answers

866 comments

1.9k users

...