Search code examples
ember.jsintegration-testingwebstormember-cliqunit

How to debug ember integration test with Webstorm


I'm trying to debug a qunit ember integration test on Webstorm. Qunit is the same framework that ember is tested with.

Our test is similar to this:

import startApp from '../helpers/start-app';
var App;
module('Integration Tests', {
  setup: function() {
    App = startApp();
  },
  teardown: function() {
    Ember.run(App, 'destroy');
});

test("Checking hub page",function(){
    expect(2);
    visit('/hub');

    andThen(function(){
        console.log(currentRouteName());
        ok('in to the function');
    });
});

I am trying these settings:

enter image description here

Edit------------------------------

I updated my run config but the application exits with the following error:

debugger listening on port 59771
version: 0.1.7
Could not find watchman, falling back to NodeWatcher for file system events
BuildingBuilding.Building..Building...Building...

Build successful - 1853ms.
c[?25l[8;NaNrtty.setRawMode: Use `process.stdin.setRawMode()` instead.

tty.js:37
    throw new Error('can\'t set raw mode on non-tty');
          ^

Solution

  • You should have used ember to run your code. And you are running it as a simple node.js application (node foo-test.js). Moreover, Node won't accept EcmaScript 6 syntax unless being run with --harmony switch. Please make sure to update your run configuration accordingly (to run ember and pass your spec as a parameter to it)