From 2d5c5d213f09fa0205d07a2d60a36581058cc40a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=CC=88rn=20Zaefferer?= Date: Mon, 26 Jan 2015 19:24:59 +0100 Subject: [PATCH] Build: Update QUnit to latest (1.17.1) Closes gh-2038 --- external/qunit/LICENSE.txt | 3 +- external/qunit/qunit.css | 26 ++++-- external/qunit/qunit.js | 178 ++++++++++++++++++++++++------------- package.json | 3 +- 4 files changed, 141 insertions(+), 69 deletions(-) diff --git a/external/qunit/LICENSE.txt b/external/qunit/LICENSE.txt index c22db4d8f..fb928a543 100644 --- a/external/qunit/LICENSE.txt +++ b/external/qunit/LICENSE.txt @@ -1,5 +1,4 @@ -Copyright 2006, 2014 jQuery Foundation and other contributors, -https://jquery.org/ +Copyright jQuery Foundation and other contributors, https://jquery.org/ This software consists of voluntary contributions made by many individuals. For exact contribution history, see the revision history diff --git a/external/qunit/qunit.css b/external/qunit/qunit.css index 385a1ce09..0eb0b0171 100644 --- a/external/qunit/qunit.css +++ b/external/qunit/qunit.css @@ -1,12 +1,12 @@ /*! - * QUnit 1.16.0 + * QUnit 1.17.1 * http://qunitjs.com/ * - * Copyright 2006, 2014 jQuery Foundation and other contributors + * Copyright jQuery Foundation and other contributors * Released under the MIT license * http://jquery.org/license * - * Date: 2014-12-03T16:32Z + * Date: 2015-01-20T19:39Z */ /** Font Family and Sizes */ @@ -77,6 +77,18 @@ #qunit-modulefilter-container { float: right; + padding: 0.2em; +} + +.qunit-url-config { + display: inline-block; + padding: 0.1em; +} + +.qunit-filter { + display: block; + float: right; + margin-left: 1em; } /** Tests: Pass/Fail */ @@ -95,11 +107,15 @@ display: none; } -#qunit-tests li.pass, #qunit-tests li.running, #qunit-tests li.fail { +#qunit-tests li.running, +#qunit-tests li.pass, +#qunit-tests li.fail, +#qunit-tests li.skipped { display: list-item; } -#qunit-tests.hidepass li.pass, #qunit-tests.hidepass li.running { +#qunit-tests.hidepass li.running, +#qunit-tests.hidepass li.pass { display: none; } diff --git a/external/qunit/qunit.js b/external/qunit/qunit.js index 82020d40d..006ca4747 100644 --- a/external/qunit/qunit.js +++ b/external/qunit/qunit.js @@ -1,12 +1,12 @@ /*! - * QUnit 1.16.0 + * QUnit 1.17.1 * http://qunitjs.com/ * - * Copyright 2006, 2014 jQuery Foundation and other contributors + * Copyright jQuery Foundation and other contributors * Released under the MIT license * http://jquery.org/license * - * Date: 2014-12-03T16:32Z + * Date: 2015-01-20T19:39Z */ (function( window ) { @@ -103,10 +103,6 @@ config = { // block until document ready blocking: true, - // when enabled, show only failing tests - // gets persisted through sessionStorage and can be changed in UI via checkbox - hidepassed: false, - // by default, run previously failed tests first // very useful in combination with "Hide passed tests" checked reorder: true, @@ -180,6 +176,10 @@ config.modules.push( config.currentModule ); } } + if ( urlParams.filter === true ) { + delete urlParams.filter; + } + QUnit.urlParams = urlParams; // String search anywhere in moduleName+testName @@ -363,24 +363,6 @@ extend( QUnit, { return undefined; }, - url: function( params ) { - params = extend( extend( {}, QUnit.urlParams ), params ); - var key, - querystring = "?"; - - for ( key in params ) { - if ( hasOwn.call( params, key ) ) { - querystring += encodeURIComponent( key ); - if ( params[ key ] !== true ) { - querystring += "=" + encodeURIComponent( params[ key ] ); - } - querystring += "&"; - } - } - return location.protocol + "//" + location.host + - location.pathname + querystring.slice( 0, -1 ); - }, - extend: extend, load: function() { @@ -578,7 +560,7 @@ function process( last ) { process( last ); } var start = now(); - config.depth = config.depth ? config.depth + 1 : 1; + config.depth = ( config.depth || 0 ) + 1; while ( config.queue.length && !config.blocking ) { if ( !defined.setTimeout || config.updateRate <= 0 || @@ -1141,7 +1123,7 @@ Test.prototype = { valid: function() { var include, - filter = config.filter && config.filter.toLowerCase(), + filter = config.filter, module = QUnit.urlParams.module && QUnit.urlParams.module.toLowerCase(), fullName = ( this.module.name + ": " + this.testName ).toLowerCase(); @@ -1164,7 +1146,7 @@ Test.prototype = { include = filter.charAt( 0 ) !== "!"; if ( !include ) { - filter = filter.slice( 1 ); + filter = filter.toLowerCase().slice( 1 ); } // If the filter matches, we need to honour include @@ -1987,12 +1969,15 @@ if ( typeof window !== "undefined" ) { } // For nodejs -if ( typeof module !== "undefined" && module.exports ) { +if ( typeof module !== "undefined" && module && module.exports ) { module.exports = QUnit; + + // For consistency with CommonJS environments' exports + module.exports.QUnit = QUnit; } // For CommonJS with exports, but without module.exports, like Rhino -if ( typeof exports !== "undefined" ) { +if ( typeof exports !== "undefined" && exports ) { exports.QUnit = QUnit; } @@ -2340,7 +2325,10 @@ function getUrlConfigHtml() { escaped = escapeText( val.id ); escapedTooltip = escapeText( val.tooltip ); - config[ val.id ] = QUnit.urlParams[ val.id ]; + if ( config[ val.id ] === undefined ) { + config[ val.id ] = QUnit.urlParams[ val.id ]; + } + if ( !val.value || typeof val.value === "string" ) { urlConfigHtml += "" + header.innerHTML + " "; } } @@ -2499,9 +2558,6 @@ function appendBanner() { if ( banner ) { banner.className = ""; - banner.innerHTML = "" + banner.innerHTML + " "; } } @@ -2533,7 +2589,8 @@ function storeFixture() { function appendUserAgent() { var userAgent = id( "qunit-userAgent" ); if ( userAgent ) { - userAgent.innerHTML = navigator.userAgent; + userAgent.innerHTML = ""; + userAgent.appendChild( document.createTextNode( navigator.userAgent ) ); } } @@ -2568,7 +2625,7 @@ function appendTest( name, testId, moduleName ) { rerunTrigger = document.createElement( "a" ); rerunTrigger.innerHTML = "Rerun"; - rerunTrigger.href = QUnit.url({ testId: testId }); + rerunTrigger.href = setUrl({ testId: testId }); testBlock = document.createElement( "li" ); testBlock.appendChild( title ); @@ -2590,17 +2647,16 @@ QUnit.begin(function( details ) { // Fixture is the only one necessary to run without the #qunit element storeFixture(); - if ( !qunit ) { - return; + if ( qunit ) { + qunit.innerHTML = + "

" + escapeText( document.title ) + "

" + + "

" + + "
" + + "

" + + "
    "; } - qunit.innerHTML = - "

    " + escapeText( document.title ) + "

    " + - "

    " + - "
    " + - "

    " + - "
      "; - + appendHeader(); appendBanner(); appendTestResults(); appendUserAgent(); @@ -2608,7 +2664,7 @@ QUnit.begin(function( details ) { appendTestsList( details.modules ); toolbarModuleFilter(); - if ( config.hidepassed ) { + if ( qunit && config.hidepassed ) { addClass( qunit.lastChild, "hidepass" ); } }); @@ -2788,7 +2844,7 @@ QUnit.testDone(function( details ) { details.assertions.length + ")"; if ( details.skipped ) { - addClass( testItem, "skipped" ); + testItem.className = "skipped"; skipped = document.createElement( "em" ); skipped.className = "qunit-skipped-label"; skipped.innerHTML = "skipped"; diff --git a/package.json b/package.json index 3ba5d8bfb..f307bbdbd 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,8 @@ "gzip-js": "0.3.2", "jsdom": "1.5.0", "load-grunt-tasks": "1.0.0", - "qunitjs": "1.16.0", + "npm": "2.1.12", + "qunitjs": "1.17.1", "requirejs": "2.1.15", "sinon": "1.12.2", "sizzle": "2.1.1",