如何调试scala.js单元测试? [英] How can I debug scala.js unit tests?

查看:118
本文介绍了如何调试scala.js单元测试?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个最大的scala.js单元测试。他们都从sbt构建运行得很好,但是我希望能够在调试器中通过单元测试。使用我最喜欢的IDE(intellij)来调试测试将无法正常工作,因为它将尝试在JVM上运行它们。有没有办法通过单元测试执行,类似于如何在浏览器(如chrome)中浏览(javascript)应用程序代码?

解决方案

目前,我所知道的(逐步)调试Scala.js代码的唯一方法是在浏览器中。您可以在sbt中为您的测试生成一个HTML转轮:

  sbt> testHtmlFastOpt 
// snip
[info]写了HTML测试运行器。将您的浏览器指向... / test-suite-fastopt-test.html

.js 0.6.10。


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

解决方案

Currently, the only way to (step-by-step) debug Scala.js code I know of, is inside a browser. You can generate 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 works starting Scala.js 0.6.10.

这篇关于如何调试scala.js单元测试?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆