question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Did not manage to run jasmine tests

See original GitHub issue

I intended to run jasmine test on win7, phpstorm7, phpstorm karma plugin. I found multiple problems…

I installed karma from git bash:

npm install -g karma

Despite the statements in the documentation it did not install the karma-* plugins, so I had to install them manually:

npm install -g karma-jasmine npm install -g karma-requirejs

After that I generated a test file with karma:

module.exports = function (config) {
    config.set({
        basePath: 'test',
        frameworks: ['jasmine', 'requirejs'],
        files: [
            {pattern: 'test-mixin.js', included: true}
        ],
        exclude: [

        ],
        reporters: ['progress'],
        port: 9876,
        colors: true,
        logLevel: config.LOG_INFO,
        autoWatch: true,
        browsers: ['Firefox'],
        captureTimeout: 60000,
        singleRun: false
    });
};

I tried to run (ofc I installed the plugins after found out by run that they are not installed), but I got the following phenomenons:

  • Sometimes I got port is already in use message, sot it automatically tries with other port (but nothing runs on the 9876 just karma). I tried with another port, I got the same results after some runs.
  • If I close the browser window manually it does not start a new window, just writes that server is not running. If I add the new window manually it starts complaining about port collisions, and opens a new window with different port.
  • I tried to change the browser to Chrome in the config file, but it still did open Firefox window.
  • I have confusing messages in phpstorm windows:
    • empty test suite (in event log)
    • no tests found
    • instantiating tests (for several minutes)
    • unable to attach test reporter to test framework or test framework quit unexpectedly
    • waiting for previous execution
    • [DEBUG] config - No config file specified
    • INFO [karma]: Delaying execution, these browsers are not ready: Firefox 26.0.0 (Windows 7)

I don’t know what happens in the background, but the test obviously does not run. :S

1 2 3 4

(The code uses core js only, it does not require browser specific tests, so I’ll change to jasmine-node instead of this.)

Issue Analytics

  • State:closed
  • Created 10 years ago
  • Comments:12 (11 by maintainers)

github_iconTop GitHub Comments

4reactions
inf3rnocommented, Jan 16, 2014

I removed the requirejs from the frameworks in the config, now it works. Something is wrong with that plugin…

0reactions
raphaelLacerdacommented, Jun 9, 2017

i was having the same problem

it was basically removing requirejs from the list of frameworks frameworks: [‘jasmine’],

or

you should put this file main-test.js (http://karma-runner.github.io/0.8/plus/RequireJS.html)

requirejs.config({ // Karma serves files from ‘/base’ baseUrl: ‘/’,

callback: window.__karma__.start

});

Read more comments on GitHub >

github_iconTop Results From Across the Web

Jasmine Tests Do Not Run - Stack Overflow
This is what Jasmine returns. For some reason none of the tests are being run. Any suggestions? angularjs · jasmine.
Read more >
Frequently Asked Questions - Jasmine Documentation
Where should I start? What does Jasmine use to test itself? Why does Jasmine have a funny hand-rolled module system? Why not use...
Read more >
Step 6: Test with Karma and Jasmine | Yeoman
We'll be editing a Jasmine script to describe our tests soon but let's see how we can run tests first. Run unit tests....
Read more >
Testing - Angular
The test output is displayed in the browser using Karma Jasmine HTML Reporter. Jasmine HTML Reporter in the browser. Click on a test...
Read more >
Testing Components in Angular 2 with Jasmine - Semaphore CI
Not only are we using the ES2015 let keyword, but we're also declaring that ... The second parameter is a function that will...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found