MCPcopy Index your code
hub / github.com/mailru/FileAPI / done

Function done

tests/qunit/qunit.js:1218–1288  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1216};
1217
1218function done() {
1219 config.autorun = true;
1220
1221 // Log the last module results
1222 if ( config.currentModule ) {
1223 runLoggingCallbacks( "moduleDone", QUnit, {
1224 name: config.currentModule,
1225 failed: config.moduleStats.bad,
1226 passed: config.moduleStats.all - config.moduleStats.bad,
1227 total: config.moduleStats.all
1228 });
1229 }
1230
1231 var i, key,
1232 banner = id( "qunit-banner" ),
1233 tests = id( "qunit-tests" ),
1234 runtime = +new Date() - config.started,
1235 passed = config.stats.all - config.stats.bad,
1236 html = [
1237 "Tests completed in ",
1238 runtime,
1239 " milliseconds.<br/>",
1240 "<span class='passed'>",
1241 passed,
1242 "</span> assertions of <span class='total'>",
1243 config.stats.all,
1244 "</span> passed, <span class='failed'>",
1245 config.stats.bad,
1246 "</span> failed."
1247 ].join( "" );
1248
1249 if ( banner ) {
1250 banner.className = ( config.stats.bad ? "qunit-fail" : "qunit-pass" );
1251 }
1252
1253 if ( tests ) {
1254 id( "qunit-testresult" ).innerHTML = html;
1255 }
1256
1257 if ( config.altertitle && typeof document !== "undefined" && document.title ) {
1258 // show ✖ for good, ✔ for bad suite result in title
1259 // use escape sequences in case file gets loaded with non-utf-8-charset
1260 document.title = [
1261 ( config.stats.bad ? "\u2716" : "\u2714" ),
1262 document.title.replace( /^[\u2714\u2716] /i, "" )
1263 ].join( " " );
1264 }
1265
1266 // clear own sessionStorage items if all tests passed
1267 if ( config.reorder && defined.sessionStorage && config.stats.bad === 0 ) {
1268 // `key` & `i` initialized at top of scope
1269 for ( i = 0; i < sessionStorage.length; i++ ) {
1270 key = sessionStorage.key( i++ );
1271 if ( key.indexOf( "qunit-test-" ) === 0 ) {
1272 sessionStorage.removeItem( key );
1273 }
1274 }
1275 }

Callers 3

Gruntfile.jsFile · 0.85
qunit.jsFile · 0.85
processFunction · 0.85

Calls 2

runLoggingCallbacksFunction · 0.85
idFunction · 0.85

Tested by

no test coverage detected