callbacks of QUnit을 사용하면이를 달성 할 수 있습니다. 그것은이를 넣어
QUnit.begin = function() {
console.log('####');
};
QUnit.testStart = function(test) {
var module = test.module ? test.module : '';
console.log('#' + module + " " + test.name + ": started.");
};
QUnit.testDone = function(test) {
var module = test.module ? test.module : '';
console.log('#' + module + " " + test.name + ": done.");
console.log('####');
};
: 그들은 여기
내 테스트 스위트에서 예입니다 (... 각 모듈 후, 각 시험 전에 예) 테스트를 실행하는 동안 여러 다른 지점에서 호출
helper.js
이라는 파일에 저장하고 테스트 index.html 페이지에 포함하십시오.
그것은 다음과 같은 출력을 생성합니다
####
#kort-Availability Includes: started.
#kort-Availability Includes: done.
####
#kort-UrlLib Constructor: started.
#kort-UrlLib Constructor: done.
####
#kort-UrlLib getCurrentUrl: started.
#kort-UrlLib getCurrentUrl: done.
####
출처
2013-02-11 14:05:45
Odi
테스트를 실행하는 시나리오를 피해야하며 통과 여부를 알기 위해 로그를 읽어야합니다. 이것은 자동화 된 테스트의 이점 대부분을 무시합니다! 로그가 단지 여분의 정보를 제공하는 것이라면 아무런 문제가 없습니다. –