我怎样才能加载HTML装置在卡莫与摩卡Javascript单元测试?

我正在寻找一个体面的测试运行器和Javascript的单元测试框架。 我的候选人是Karma和Mocha。 以前我使用过JsTestDriver,在那里添加HTML设备很简单,但我无法找到一种方法来加载HTML碎片并使用Karma testrunner从Mocha测试中访问它


我有一个在jasmine中使用html fixtures的演示,演示描述包含指向Karma运行的screencast和github repo的链接。 看到这个链接。


最终的解决方案是Karma testrunner与RequireJS相结合,它具有文本插件,使得HTML设备的加载非常容易。 在这个扫雷游戏中可以看到一个可行的例子。 它仍处于发展阶段,但图书馆和结构工作正在发挥作用。

链接地址: http://www.djcxy.com/p/72243.html

上一篇: How can I load HTML fixtures for Javascript unit tests in Karma with Mocha?

下一篇: How to change the language of a TextBox automatically