2012-12-25 2 views

답변

2

각 사양. 기본적으로 당신이해야 할 일은 사양이 시작하기 전에 시간을 기록하는 것입니다. reportSpecStarting (사양이 실행되기 바로 직전입니다)이 호출되고, reportSpecResults (스펙이 실행이 끝난 직후입니다.)

따라서 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(); 
}; 
0

Jasmines HTMLReporter를 사용하면 어떨까요? (아래쪽 아래쪽으로) http://pivotal.github.com/jasmine/

음 ... 아마 각 파일이 개별적으로 실행되도록 반복 할 수 있습니까? (안 좋은 대답 :() 기본 ConsoleReporter은 모든 시험 경과 시간을보고,하지만 당신은 그것의 source code를 보면 당신이에 대한 경과 시간을 추가 수정하는 것은 매우 쉽게 볼 수 http://elegantcode.com/2011/03/07/taking-baby-steps-with-node-js-bdd-style-unit-tests-with-jasmine-node-sprinkled-with-some-should/

+0

분명히 'jasmine-node'에는 HTMLReporter 만 포함 된 터미널이 없습니다. – Fluffy

+0

doh ..... phooey – thescientist

관련 문제