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.
As discussed today, it would be nice to have Mocha as a unit test runner (not only Selenium) so there would be 3 unit test runners: JSTDdriver, Karma and Mocha. Thank you
Changeset: 826614c5d6e8 Author: Theofanis Oikonomou <theofanis@netbeans.org> Date: 2014-12-10 03:53 Message:
Added also autowatch support for unit tests (-w mocha option). If the option is checked in project properties, you only have to invoke the test project action once. Then go ahead and modify any test file under the unit tests folder and save. Unit tests are re-run automatically. Please let me know if something more can be done to improve this. Thanks
Integrated into 'main-silver', will be available in build *201412111033* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/826614c5d6e8 User: Theofanis Oikonomou <theofanis@netbeans.org> Log: Task #249239 - Add Mocha as unit test runner
Thank you. I might be doing something wrong but when I try Test action on project with Mocha unit tests, it fails with following "/usr/local/bin/node" "/home/vriha/Documents/repo/web-main/javascript.nodejs/samples_src/Messages/node_modules/mocha/bin/mocha" "-w" "-t" "10000" "-R" "/home/vriha/Downloads/netbeans/webcommon/mocha/netbeans-reporter.js" /home/vriha/Documents/repo/web-main/javascript.nodejs/samples_src/Messages/node_modules/mocha/lib/utils.js:356 if (!files.length) throw new Error("cannot resolve path (or pattern) '" ^ Error: cannot resolve path (or pattern) 'test' at Object.lookupFiles (/home/vriha/Documents/repo/web-main/javascript.nodejs/samples_src/Messages/node_modules/mocha/lib/utils.js:356:32) at runAgain (/home/vriha/Documents/repo/web-main/javascript.nodejs/samples_src/Messages/node_modules/mocha/bin/_mocha:302:30) at Array.forEach (native) at Object.<anonymous> (/home/vriha/Documents/repo/web-main/javascript.nodejs/samples_src/Messages/node_modules/mocha/bin/_mocha:301:6) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Function.Module.runMain (module.js:497:10) at startup (node.js:119:16) at node.js:901:3 Done. It seems like maybe there is no parameter to specify test folder? Thanks Product Version: NetBeans IDE Dev (Build 201412111033) Java: 1.7.0_71; Java HotSpot(TM) Client VM 24.71-b01 Runtime: Java(TM) SE Runtime Environment 1.7.0_71-b14 System: Linux version 3.13.0-35-generic running on i386; UTF-8; en_US (nb)
(In reply to Vladimir Riha from comment #4) > > It seems like maybe there is no parameter to specify test folder? > > I believe I know why you get this exception. I get identical one if I have Unit Tests Folder set in project properties to some folder other than "test". If I rename unit tests folder to "test" everything works fine as mocha by default looks for a folder named "test". Is this the case with you too? If yes then I will enhance mocha support to run all tests under whichever folder is set as Unit Tests Folder set in project properties.
Yes, you are right. The folder had a browser_tests name
Changeset: 5fae8e0b3dcb Author: Theofanis Oikonomou <theofanis@netbeans.org> Date: 2014-12-15 12:46 Message:
Integrated into 'main-silver', will be available in build *201412160001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/5fae8e0b3dcb User: Theofanis Oikonomou <theofanis@netbeans.org> Log: Task #249239 - Add Mocha as unit test runner
Thank you, verified Product Version: NetBeans IDE Dev (Build 201412160001) Java: 1.8.0_11; Java HotSpot(TM) 64-Bit Server VM 25.11-b03 Runtime: Java(TM) SE Runtime Environment 1.8.0_11-b12 System: Windows 7 version 6.1 running on amd64; Cp1252; en_US (nb)