Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想知道是否有更好的方法来使用 phantomJS 测试 mocha 测试,然后为每个测试创建一个 html 文件。那么是否有一个 grunt 插件或类似的东西可以让我在单个 JavaScript 文件中编写我的测试并在运行测试时连接这些文件?
你见过grunt-mocha吗?另外,为什么每次测试都必须有一个 HTML 文件?您可以在同一个 HTML 文件中包含多个套件。
grunt-mocha
<script src="spec1.js"></script> <script src="spec2.js"></script> <script src="spec3.js"></script> <script> mocha.run(); </script>