如何判断哪些testing花费最多的时间在茉莉花?
我注意到整套Jasminetesting开始花费更多的时间,但是我不确定哪些testing会导致延迟。 有没有办法find这一点,而不是单独运行每个testing?
基本的ConsoleReporter
只报告所有testing的时间,但是如果你看看它的源代码 ,你会发现很容易修改每个规格的时间。 基本上你需要做的就是当函数reportSpecStarting
(就在一个spec开始运行之前)被调用时logging一个spec开始的时间,并且当函数reportSpecStarting
(刚刚在一个spec完成运行之后)被输出。
所以如果你用这个修改了ConsoleReporter
,它会输出你每个规格的名称和它们的经过时间:
this.reportSpecStarting = function() { this.specStartingTime = this.now(); }; this.reportSpecResults = function(spec) { var results = spec.results(); print(results.description + " "); if (results.skipped) { yellowStar(); } else if (results.passed()) { greenDot(); } else { redF(); } print(" (" + (this.now() - this.specStartingTime) + "ms)"); newline(); };
那么使用Jasmines HTMLReporter呢? (向下) http://pivotal.github.com/jasmine/
嗯..也许你可以循环它,使每个文件被单独执行? (不是最好的答案:() http://elegantcode.com/2011/03/07/taking-baby-steps-with-node-js-bdd-style-unit-tests-with-jasmine-node-sprinkled-有几家,应该/
- Jasmine Nodetestingsubprocess
- 量angular器:检查链接是否包含某些文本。 预期是
- 如何访问茉莉花量angular器执行spec的文件名?
- 如何使EXPECT条件等待承诺解决(代码包装在一个方法中)?
- 我怎么能从另一个JS通过Protractor JS调用外部JS?
- 如何在node.js intellisense中启用Jasmine支持
- 用Jasmine / NodetestingAngular:未捕获types错误“不能设置'mock'的属性undefined
- 量angular器停止工作。 你能明白为什么吗?
- 量angular器:正确使用我的testing中的waitReady.js文件