()
| 809 | }; |
| 810 | |
| 811 | function done() { |
| 812 | config.autorun = true; |
| 813 | |
| 814 | // Log the last module results |
| 815 | if ( config.previousModule ) { |
| 816 | runLoggingCallbacks( "moduleDone", QUnit, { |
| 817 | name: config.previousModule, |
| 818 | failed: config.moduleStats.bad, |
| 819 | passed: config.moduleStats.all - config.moduleStats.bad, |
| 820 | total: config.moduleStats.all |
| 821 | }); |
| 822 | } |
| 823 | delete config.previousModule; |
| 824 | |
| 825 | var i, key, |
| 826 | banner = id( "qunit-banner" ), |
| 827 | tests = id( "qunit-tests" ), |
| 828 | runtime = +new Date() - config.started, |
| 829 | passed = config.stats.all - config.stats.bad, |
| 830 | html = [ |
| 831 | "Tests completed in ", |
| 832 | runtime, |
| 833 | " milliseconds.<br/>", |
| 834 | "<span class='passed'>", |
| 835 | passed, |
| 836 | "</span> assertions of <span class='total'>", |
| 837 | config.stats.all, |
| 838 | "</span> passed, <span class='failed'>", |
| 839 | config.stats.bad, |
| 840 | "</span> failed." |
| 841 | ].join( "" ); |
| 842 | |
| 843 | if ( banner ) { |
| 844 | banner.className = ( config.stats.bad ? "qunit-fail" : "qunit-pass" ); |
| 845 | } |
| 846 | |
| 847 | if ( tests ) { |
| 848 | id( "qunit-testresult" ).innerHTML = html; |
| 849 | } |
| 850 | |
| 851 | if ( config.altertitle && defined.document && document.title ) { |
| 852 | // show ✖ for good, ✔ for bad suite result in title |
| 853 | // use escape sequences in case file gets loaded with non-utf-8-charset |
| 854 | document.title = [ |
| 855 | ( config.stats.bad ? "\u2716" : "\u2714" ), |
| 856 | document.title.replace( /^[\u2714\u2716] /i, "" ) |
| 857 | ].join( " " ); |
| 858 | } |
| 859 | |
| 860 | // clear own sessionStorage items if all tests passed |
| 861 | if ( config.reorder && defined.sessionStorage && config.stats.bad === 0 ) { |
| 862 | // `key` & `i` initialized at top of scope |
| 863 | for ( i = 0; i < sessionStorage.length; i++ ) { |
| 864 | key = sessionStorage.key( i++ ); |
| 865 | if ( key.indexOf( "qunit-test-" ) === 0 ) { |
| 866 | sessionStorage.removeItem( key ); |
| 867 | } |
| 868 | } |
no test coverage detected