MCPcopy
hub / github.com/playcanvas/engine / done

Function done

tests/qunit/qunit.js:1092–1162  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1090};
1091
1092function done() {
1093 config.autorun = true;
1094
1095 // Log the last module results
1096 if ( config.currentModule ) {
1097 runLoggingCallbacks( "moduleDone", QUnit, {
1098 name: config.currentModule,
1099 failed: config.moduleStats.bad,
1100 passed: config.moduleStats.all - config.moduleStats.bad,
1101 total: config.moduleStats.all
1102 });
1103 }
1104
1105 var i, key,
1106 banner = id( "qunit-banner" ),
1107 tests = id( "qunit-tests" ),
1108 runtime = +new Date() - config.started,
1109 passed = config.stats.all - config.stats.bad,
1110 html = [
1111 "Tests completed in ",
1112 runtime,
1113 " milliseconds.<br/>",
1114 "<span class='passed'>",
1115 passed,
1116 "</span> tests of <span class='total'>",
1117 config.stats.all,
1118 "</span> passed, <span class='failed'>",
1119 config.stats.bad,
1120 "</span> failed."
1121 ].join( "" );
1122
1123 if ( banner ) {
1124 banner.className = ( config.stats.bad ? "qunit-fail" : "qunit-pass" );
1125 }
1126
1127 if ( tests ) {
1128 id( "qunit-testresult" ).innerHTML = html;
1129 }
1130
1131 if ( config.altertitle && typeof document !== "undefined" && document.title ) {
1132 // show ✖ for good, ✔ for bad suite result in title
1133 // use escape sequences in case file gets loaded with non-utf-8-charset
1134 document.title = [
1135 ( config.stats.bad ? "\u2716" : "\u2714" ),
1136 document.title.replace( /^[\u2714\u2716] /i, "" )
1137 ].join( " " );
1138 }
1139
1140 // clear own sessionStorage items if all tests passed
1141 if ( config.reorder && defined.sessionStorage && config.stats.bad === 0 ) {
1142 // `key` & `i` initialized at top of scope
1143 for ( i = 0; i < sessionStorage.length; i++ ) {
1144 key = sessionStorage.key( i++ );
1145 if ( key.indexOf( "qunit-test-" ) === 0 ) {
1146 sessionStorage.removeItem( key );
1147 }
1148 }
1149 }

Callers 1

processFunction · 0.85

Calls 2

runLoggingCallbacksFunction · 0.85
idFunction · 0.85

Tested by

no test coverage detected