This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 271852 - Testing framework Mocha 4 not working in Netbeans 8.2
Summary: Testing framework Mocha 4 not working in Netbeans 8.2
Status: NEW
Alias: None
Product: javascript
Classification: Unclassified
Component: Testing (show other bugs)
Version: 8.2
Hardware: PC Other
: P3 normal (vote)
Assignee: Theofanis Oikonomou
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-11-27 22:42 UTC by Eccenux
Modified: 2017-11-27 22:42 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eccenux 2017-11-27 22:42:23 UTC
Trying to setup Mocha on Windows but it doesn't seem to work with latest Mocha (4.0.1).

When I run tests Netbeans just waits, and waits, and... nothing happens. When I run the command in command line an error appears:
-----------------
C:\_Varia\UnitTestingTest>"C:\Program Files\nodejs\node.exe" "C:\_Varia\UnitTestingTest\node_modules\mocha/bin/mocha" "-t" "500" "-R" "C:\Program Files\NetBeans 8.2\webcommon\mocha\netbeans-reporter.js" "test/**/*.js"
"C:\Program Files\NetBeans 8.2\webcommon\mocha\netbeans-reporter.js" reporter not found
d:\_Varia\UnitTestingTest\node_modules\mocha\lib\mocha.js:174
      throw new Error('invalid reporter "' + reporter + '"');
      ^

Error: invalid reporter "C:\Program Files\NetBeans 8.2\webcommon\mocha\netbeans-reporter.js"
    at Mocha.reporter (d:\_Varia\UnitTestingTest\node_modules\mocha\lib\mocha.js:174:13)
    at Object.<anonymous> (d:\_Varia\UnitTestingTest\node_modules\mocha\bin\_mocha:220:7)
    at Module._compile (module.js:635:30)
    at Object.Module._extensions..js (module.js:646:10)
    at Module.load (module.js:554:32)
    at tryModuleLoad (module.js:497:12)
    at Function.Module._load (module.js:489:3)
    at Function.Module.runMain (module.js:676:10)
    at startup (bootstrap_node.js:187:16)
    at bootstrap_node.js:608:3
-----------------

Mocha itself works fine:
-----------------
C:\_Varia\UnitTestingTest>"C:\Program Files\nodejs\node.exe" "C:\_Varia\UnitTestingTest\node_modules\mocha/bin/mocha" "-t" "500" "test/**/*.js"


  Some module tests
    √ should be 123


  1 passing (15ms)
-----------------

So two things actually:
1. Netbeans should support Mocha 4 or say which version it supports.
2. Netbeans should catch errors of commands it runs.