How can I debug scala.js unit tests?

I have some scala.js unit tests written in utest. They all work fine with the sbt build, however I would like to go through unit tests in the debugger. Using my favorite IDE (intellij) to debug tests will not work because it will try to run them on the JVM. Is there a way to execute a unit test, similar to how you can execute application code (javascript) in browsers like chrome?

+4
source share
1 answer

Currently, the only way (in stages) to debug Scala.js code that I know is inside the browser. You can create an HTML runner for your tests in sbt:

sbt> testHtmlFastOpt
// snip
[info] Wrote HTML test runner. Point your browser to .../test-suite-fastopt-test.html

This has been working since Scala.js 0.6.10.

+9
source

All Articles