Debugging Tests - Getting Testem/Qunit from closing test browser window

2.5k views Asked by At

Ok, I'm using Ember-App-Kit which uses Testem/Qunit, but I can't figure out how to debug tests, especially since either Testem or Qunit close the QUnit tests window so I can't set any breakpoints, and node debug with debugger doesn't work since it's in browser.

I tried to set the debug: true property in grunt-contrib-testem but that didn't do anything..

So if anyone can help, that would be awesome. I'm using the default EAK setup without any changes.

1

There are 1 answers

0
andrewhao On BEST ANSWER

You'll need to do a few things:

  1. Keep the grunt server task running in one window -- this will rebuild your test assets and compile them into the build/test directory.
  2. Run Testem in standalone mode -- you'll first have to install testem via npm (npm install -g testem) then call testem from your app's root directory. Alternatively, you can run grunt test:server, which will let you run testem without installing globally.
  3. Drop a debugger statement in your test body. In an open Chrome window running the Testem harness, open your Developer Tools console window.
  4. Refresh the Chrome window, and you'll now have breakpoint capabilities in your tests.