我是靠谱客的博主 坚强项链,这篇文章主要介绍单元测试文档 软件单元描述,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单元测试文档的全部内容,更多相关单元测试文档内容请搜索靠谱客的其他文章。

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

评论列表共有 0 条评论

立即
投稿
返回
顶部