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.
Karma is configured to run tests with qunit (npm install karma-qunit)and watching changed files to automatically rerun tests. Starting Karma prints out "SUCCESS" on console but shows "No Tests executed" in the unit testing area (see Step 1 in attached screenshot). If I click rerun tests or change a test-File, console prints out "SUCCESS" and "done.", but the unit testing area is stuck in "Running..." (see Step 2 in screeshot). Only a restart of Karma results in step 1. // karma.conf.js (located in /karma.conf.js) // / is seen as project root module.exports = function(config) { config.set({ frameworks: ['qunit'], files: [ 'tests/js/unit/*.js' ], browsers: ['PhantomJS'], plugins: [ 'karma-qunit' ] }); }; // calculatorTests.js (located in /tests/js/unit/calculatorTests.js) test('one should equal one', function() { equal(1, 1, 'error: one did not equal one'); });
Created attachment 145777 [details] Screenshot
Thank you for reporting. Reproduced also with Chrome. Does not happen with JasmineJS Product Version: NetBeans IDE 8.0 (Build 201403032200) Java: 1.8.0; Java HotSpot(TM) Client VM 25.0-b69 Runtime: Java(TM) SE Runtime Environment 1.8.0-b131 System: Linux version 3.2.0-48-generic-pae running on i386; UTF-8; en_US (nb)
Guys, could anyone please attach a sample project with qunit tests? Simply reopen this issue, thanks.
Created attachment 146362 [details] Export QunitProject.zip Added a sample netbeans project
You are not going to fix this issue, right? ;) Thanks for the sample project.
Your project does not use Karma as a JavaScript tester, does not have properly set the Tests folder. If I setup it manually, I get this: "/home/gapon/NetBeansProjects/QunitProject/node_modules/karma/bin/karma" "start" "/home/gapon/NetBeansProjects/QunitProject/karma.conf.js" "--port" "9876" INFO [karma]: Karma v0.12.1 server started at http://localhost:9876/ INFO [launcher]: Starting browser PhantomJS INFO [PhantomJS 1.9.2 (Linux)]: Connected on socket Wc8GIKuTqWHXO2Ycx3yA with id 55179949 WARN [PhantomJS 1.9.2 (Linux)]: Adapter did not report total number of specs. PhantomJS 1.9.2 (Linux): Executed 0 of 0 SUCCESS (0 secs / 0 secs) ERROR [karma]: [TypeError: Cannot call method 'push' of undefined] TypeError: Cannot call method 'push' of undefined at onBrowserStart (/home/gapon/NetBeansProjects/QunitProject/node_modules/karma/lib/reporters/base.js:14:20) Do I need to do any other steps to fix the project? Please, reopen this issue and attach a _correctly_ configured NetBeans project (it is likely better to use an HTML5 project rather than a PHP project since we can focus on Karma directly). It is totally OK to attach a project without node_modules directory and just tell us "invoke this or that command to install dependencies" etc. Thanks.
Tomasi, you need to have older Karma. Uninstall Karma from the project $ cd [projectRoot] $ npm uninstall karma and run following in project root: $ npm install karma@0.10
Btw I added 'karma-junit-reporter' to the list of plugins in karma.conf.js but it didn't change anything. Should the fix be safe and easy, I'd vote for patch candidate but please feel free to remove it.
Yes, I agree with the patch candidate (the fix is quite easy). Thanks. http://hg.netbeans.org/web-main/rev/cc765f1d520f
Integrated into 'main-silver', will be available in build *201404180001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/cc765f1d520f User: Tomas Mysik <tmysik@netbeans.org> Log: #242578 - Karma stuck on "running" qunit based javascript unit tests
Verified, thank you Product Version: NetBeans IDE Dev (Build 201404180001) Java: 1.8.0; Java HotSpot(TM) Client VM 25.0-b70 Runtime: Java(TM) SE Runtime Environment 1.8.0-b132 System: Linux version 3.2.0-60-generic-pae running on i386; UTF-8; en_US (nb)
Transplanted to releases repo to the branch release80. Thanks. http://hg.netbeans.org/releases/rev/0ee0c4dc6428
Integrated into 'releases/release80', will be available in build *201404240045* or newer. Wait for official and publicly available build. Changeset: http://hg.netbeans.org/releases/rev/0ee0c4dc6428 User: Tomas Mysik <tmysik@netbeans.org> Log: #242578 - Karma stuck on "running" qunit based javascript unit tests (transplanted from cc765f1d520f12d4150fe6e6723c39e8bab48712)
verified in patch1 Product Version: NetBeans IDE 8.0 (Build 201403101706) Updates: NetBeans IDE is updated to version NetBeans 8.0 Patch 1 Java: 1.8.0_05; Java HotSpot(TM) Client VM 25.5-b02 Runtime: Java(TM) SE Runtime Environment 1.8.0_05-b13 System: Linux version 3.2.0-60-generic-pae running on i386; UTF-8; en_US (nb)
... Jasmine support works as well (tested with AngularSeed)