我是靠谱客的博主 坚强项链,最近开发中收集的这篇文章主要介绍单元测试文档 软件单元描述,QUnit单元测试文档,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

//begin  Register a callback to fire whenever the test suite begins.

QUnit.begin( function ( details ) {

console.log( "Test amount:", details.totalTests );

} );

//done  Register a callback to fire whenever the test suite ends.

QUnit.done( function ( details ) {

console.log( "Total: ", details.total, " Failed: ", details.failed, " Passed: ", details.passed, " Runtime: ", details.runtime );

} );

//log  Register a callback to fire whenever an assertion completes.

QUnit.log( function ( details ) {

if ( details.result ) {

return;

}

var loc = details.module + ": " + details.name + ": ",

output = "FAILED: " + loc + ( details.message ? details.message + ", " : "" );

if ( details.actual ) {

output += "expected: " + details.expected + ", actual: " + details.actual;

}

if ( details.source ) {

output += ", " + details.source;

}

console.log( output );

} );

//moduleStart  Register a callback to fire whenever a module begins.

QUnit.moduleStart( function ( details ) {

console.log( "Now running: ", details.name );

} );

//moduleDone  Register a callback to fire whenever a module ends.

QUnit.moduleDone( function ( details ) {

console.log( "Finished running: ", details.name, "Failed/total: ", details.failed, details.total );

} );

//testStart Register a callback to fire whenever a test begins.

QUnit.testStart( function ( details ) {

console.log( "Now running: ", details.module, details.name );

} );

//testDone Register a callback to fire whenever a test ends.

QUnit.testDone( function ( details ) {

console.log( "Finished running: ", details.module, details.name, "Failed/total: ", details.failed, details.total, details.duration );

} );

//endregion

最后

以上就是坚强项链为你收集整理的单元测试文档 软件单元描述,QUnit单元测试文档的全部内容,希望文章能够帮你解决单元测试文档 软件单元描述,QUnit单元测试文档所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(50)

评论列表共有 0 条评论

立即
投稿
返回
顶部