Build: Update QUnit from 1.23.1 to 2.9.2

Closes gh-4307
This commit is contained in:
Michał Gołębiowski-Owczarek 2019-03-04 20:10:21 +01:00 committed by GitHub
parent 16ad9889f5
commit 6ced2639b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 6786 additions and 4538 deletions

View File

@ -80,14 +80,9 @@ module.exports = function( grunt ) {
"npo/npo.js": "native-promise-only/npo.js",
"qunit/qunit.js": "qunitjs/qunit/qunit.js",
"qunit/qunit.css": "qunitjs/qunit/qunit.css",
"qunit/LICENSE.txt": "qunitjs/LICENSE.txt",
"qunit-assert-step/qunit-assert-step.js":
"qunit-assert-step/qunit-assert-step.js",
"qunit-assert-step/MIT-LICENSE.txt":
"qunit-assert-step/MIT-LICENSE.txt",
"qunit/qunit.js": "qunit/qunit/qunit.js",
"qunit/qunit.css": "qunit/qunit/qunit.css",
"qunit/LICENSE.txt": "qunit/LICENSE.txt",
"requirejs/require.js": "requirejs/require.js",
@ -171,7 +166,6 @@ module.exports = function( grunt ) {
],
files: [
"test/data/jquery-1.9.1.js",
"external/qunit-assert-step/qunit-assert-step.js",
"external/sinon/sinon.js",
"external/npo/npo.js",
"external/requirejs/require.js",

View File

@ -1,21 +0,0 @@
Copyright jQuery Foundation and other contributors
http://jquery.com/
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@ -1,127 +0,0 @@
(function(factory) {
// NOTE:
// All techniques except for the "browser globals" fallback will extend the
// provided QUnit object but return the isolated API methods
// For AMD: Register as an anonymous AMD module with a named dependency on "qunit".
if (typeof define === "function" && define.amd) {
define(["qunit"], factory);
}
// For Node.js
else if (typeof module !== "undefined" && module && module.exports && typeof require === "function") {
module.exports = factory(require("qunitjs"));
}
// For CommonJS with `exports`, but without `module.exports`, like Rhino
else if (typeof exports !== "undefined" && exports && typeof require === "function") {
var qunit = require("qunitjs");
qunit.extend(exports, factory(qunit));
}
// For browser globals
else {
factory(QUnit);
}
}(function(QUnit) {
/**
* Find an appropriate `Assert` context to `push` results to.
* @param * context - An unknown context, possibly `Assert`, `Test`, or neither
* @private
*/
function _getPushContext(context) {
var pushContext;
if (context && typeof context.push === "function") {
// `context` is an `Assert` context
pushContext = context;
}
else if (context && context.assert && typeof context.assert.push === "function") {
// `context` is a `Test` context
pushContext = context.assert;
}
else if (
QUnit && QUnit.config && QUnit.config.current && QUnit.config.current.assert &&
typeof QUnit.config.current.assert.push === "function"
) {
// `context` is an unknown context but we can find the `Assert` context via QUnit
pushContext = QUnit.config.current.assert;
}
else if (QUnit && typeof QUnit.push === "function") {
pushContext = QUnit.push;
}
else {
throw new Error("Could not find the QUnit `Assert` context to push results");
}
return pushContext;
}
/**
* Find an appropriate `Test` context to `push` results to.
* @param * context - An unknown context, possibly `Assert`, `Test`, or neither
* @private
*/
function _getTestContext(context) {
var testContext;
if (context && typeof context.push === "function" && context.test) {
// `context` is an `Assert` context
testContext = context.test;
}
else if (context && context.assert && typeof context.assert.push === "function") {
// `context` is a `Test` context
testContext = context;
}
else if (
QUnit && QUnit.config && QUnit.config.current && QUnit.config.current.assert &&
typeof QUnit.config.current.assert.push === "function"
) {
// `context` is an unknown context but we can find the `Test` context via QUnit
testContext = QUnit.config.current;
}
else {
throw new Error("Could not find the QUnit `Test` context to maintain state");
}
return testContext;
}
var api = {
/**
* Check the sequence/order
*
* @example test('Example unit test', function(assert) { assert.step(1); setTimeout(function () { assert.step(3); start(); }, 100); assert.step(2); stop(); });
* @param Number expected The excepted step within the test()
* @param String message (optional)
*/
step: function(expected, message) {
var actual,
pushContext = _getPushContext(this),
testContext = _getTestContext(this);
if (typeof message === "undefined") {
message = "step " + expected;
}
// If this is the first time that `assert.step` has been called for the
// current test, set its initial `step` counter to `0`
if (typeof testContext.step === "undefined") {
testContext.step = 0;
}
// Increment internal step counter
actual = ++testContext.step;
pushContext.push(QUnit.equiv(actual, expected), actual, expected, message);
}
};
QUnit.extend(QUnit.assert, api);
return api;
}));

View File

@ -1,8 +1,8 @@
Copyright jQuery Foundation and other contributors, https://jquery.org/
Copyright JS Foundation and other contributors, https://js.foundation
This software consists of voluntary contributions made by many
individuals. For exact contribution history, see the revision history
available at https://github.com/jquery/qunit
available at https://github.com/qunitjs/qunit
The following license applies to all parts of this software except as
documented below:

View File

@ -1,12 +1,12 @@
/*!
* QUnit 1.23.1
* QUnit 2.9.2
* https://qunitjs.com/
*
* Copyright jQuery Foundation and other contributors
* Released under the MIT license
* https://jquery.org/license
*
* Date: 2016-04-12T17:29Z
* Date: 2019-02-21T22:49Z
*/
/** Font Family and Sizes */
@ -27,7 +27,7 @@
}
/** Header */
/** Header (excluding toolbar) */
#qunit-header {
padding: 0.5em 0 0.5em 1em;
@ -52,51 +52,161 @@
color: #FFF;
}
#qunit-testrunner-toolbar label {
display: inline-block;
padding: 0 0.5em 0 0.1em;
}
#qunit-banner {
height: 5px;
}
#qunit-filteredTest {
padding: 0.5em 1em 0.5em 1em;
color: #366097;
background-color: #F4FF77;
}
#qunit-userAgent {
padding: 0.5em 1em 0.5em 1em;
color: #FFF;
background-color: #2B81AF;
text-shadow: rgba(0, 0, 0, 0.5) 2px 2px 1px;
}
/** Toolbar */
#qunit-testrunner-toolbar {
padding: 0.5em 1em 0.5em 1em;
color: #5E740B;
background-color: #EEE;
overflow: hidden;
}
#qunit-filteredTest {
padding: 0.5em 1em 0.5em 1em;
background-color: #F4FF77;
color: #366097;
#qunit-testrunner-toolbar .clearfix {
height: 0;
clear: both;
}
#qunit-userAgent {
padding: 0.5em 1em 0.5em 1em;
background-color: #2B81AF;
color: #FFF;
text-shadow: rgba(0, 0, 0, 0.5) 2px 2px 1px;
}
#qunit-modulefilter-container {
float: right;
padding: 0.2em;
}
.qunit-url-config {
#qunit-testrunner-toolbar label {
display: inline-block;
padding: 0.1em;
}
.qunit-filter {
display: block;
#qunit-testrunner-toolbar input[type=checkbox],
#qunit-testrunner-toolbar input[type=radio] {
margin: 3px;
vertical-align: -2px;
}
#qunit-testrunner-toolbar input[type=text] {
box-sizing: border-box;
height: 1.6em;
}
.qunit-url-config,
.qunit-filter,
#qunit-modulefilter {
display: inline-block;
line-height: 2.1em;
}
.qunit-filter,
#qunit-modulefilter {
float: right;
position: relative;
margin-left: 1em;
}
.qunit-url-config label {
margin-right: 0.5em;
}
#qunit-modulefilter-search {
box-sizing: border-box;
width: 400px;
}
#qunit-modulefilter-search-container:after {
position: absolute;
right: 0.3em;
content: "\25bc";
color: black;
}
#qunit-modulefilter-dropdown {
/* align with #qunit-modulefilter-search */
box-sizing: border-box;
width: 400px;
position: absolute;
right: 0;
top: 50%;
margin-top: 0.8em;
border: 1px solid #D3D3D3;
border-top: none;
border-radius: 0 0 .25em .25em;
color: #000;
background-color: #F5F5F5;
z-index: 99;
}
#qunit-modulefilter-dropdown a {
color: inherit;
text-decoration: none;
}
#qunit-modulefilter-dropdown .clickable.checked {
font-weight: bold;
color: #000;
background-color: #D2E0E6;
}
#qunit-modulefilter-dropdown .clickable:hover {
color: #FFF;
background-color: #0D3349;
}
#qunit-modulefilter-actions {
display: block;
overflow: auto;
/* align with #qunit-modulefilter-dropdown-list */
font: smaller/1.5em sans-serif;
}
#qunit-modulefilter-dropdown #qunit-modulefilter-actions > * {
box-sizing: border-box;
max-height: 2.8em;
display: block;
padding: 0.4em;
}
#qunit-modulefilter-dropdown #qunit-modulefilter-actions > button {
float: right;
font: inherit;
}
#qunit-modulefilter-dropdown #qunit-modulefilter-actions > :last-child {
/* insert padding to align with checkbox margins */
padding-left: 3px;
}
#qunit-modulefilter-dropdown-list {
max-height: 200px;
overflow-y: auto;
margin: 0;
border-top: 2px groove threedhighlight;
padding: 0.4em 0 0;
font: smaller/1.5em sans-serif;
}
#qunit-modulefilter-dropdown-list li {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
#qunit-modulefilter-dropdown-list .clickable {
display: block;
padding-left: 0.15em;
}
/** Tests: Pass/Fail */
#qunit-tests {
@ -116,7 +226,8 @@
#qunit-tests li.running,
#qunit-tests li.pass,
#qunit-tests li.fail,
#qunit-tests li.skipped {
#qunit-tests li.skipped,
#qunit-tests li.aborted {
display: list-item;
}
@ -125,7 +236,7 @@
}
#qunit-tests.hidepass li.running,
#qunit-tests.hidepass li.pass {
#qunit-tests.hidepass li.pass:not(.todo) {
visibility: hidden;
position: absolute;
width: 0;
@ -202,14 +313,14 @@
}
#qunit-tests del {
background-color: #E0F2BE;
color: #374E0C;
background-color: #E0F2BE;
text-decoration: none;
}
#qunit-tests ins {
background-color: #FFCACA;
color: #500;
background-color: #FFCACA;
text-decoration: none;
}
@ -264,12 +375,16 @@
#qunit-banner.qunit-fail { background-color: #EE5757; }
/*** Aborted tests */
#qunit-tests .aborted { color: #000; background-color: orange; }
/*** Skipped tests */
#qunit-tests .skipped {
background-color: #EBECE9;
}
#qunit-tests .qunit-todo-label,
#qunit-tests .qunit-skipped-label {
background-color: #F4FF77;
display: inline-block;
@ -280,19 +395,35 @@
margin: -0.4em 0.4em -0.4em 0;
}
#qunit-tests .qunit-todo-label {
background-color: #EEE;
}
/** Result */
#qunit-testresult {
padding: 0.5em 1em 0.5em 1em;
color: #2B81AF;
background-color: #D2E0E6;
border-bottom: 1px solid #FFF;
}
#qunit-testresult .clearfix {
height: 0;
clear: both;
}
#qunit-testresult .module-name {
font-weight: 700;
}
#qunit-testresult-display {
padding: 0.5em 1em 0.5em 1em;
width: 85%;
float:left;
}
#qunit-testresult-controls {
padding: 0.5em 1em 0.5em 1em;
width: 10%;
float:left;
}
/** Fixture */

10920
external/qunit/qunit.js vendored

File diff suppressed because it is too large Load Diff

View File

@ -46,18 +46,17 @@
"husky": "1.3.1",
"insight": "0.10.1",
"jsdom": "13.2.0",
"karma": "4.0.0",
"karma": "4.0.1",
"karma-browserstack-launcher": "1.4.0",
"karma-chrome-launcher": "2.2.0",
"karma-firefox-launcher": "1.1.0",
"karma-ie-launcher": "1.0.0",
"karma-qunit": "1.2.1",
"karma-qunit": "3.0.0",
"load-grunt-tasks": "4.0.0",
"native-promise-only": "0.8.1",
"promises-aplus-tests": "2.1.2",
"q": "1.5.1",
"qunit-assert-step": "1.1.1",
"qunitjs": "1.23.1",
"qunit": "2.9.2",
"raw-body": "2.3.3",
"requirejs": "2.3.6",
"sinon": "2.3.7",

View File

@ -1 +1 @@
window.ok( !QUnit.moduleTypeSupported, "evaluated: inner nomodule script with src" );
QUnit.assert.ok( !QUnit.moduleTypeSupported, "evaluated: inner nomodule script with src" );

View File

@ -1 +1 @@
window.ok( !QUnit.moduleTypeSupported, "evaluated: nomodule script with src" );
QUnit.assert.ok( !QUnit.moduleTypeSupported, "evaluated: nomodule script with src" );

View File

@ -13,7 +13,6 @@
<script src="data/jquery-1.9.1.js"></script>
<script src="../external/qunit/qunit.js"></script>
<script src="../external/qunit-assert-step/qunit-assert-step.js"></script>
<script src="../external/sinon/sinon.js"></script>
<script src="../external/npo/npo.js"></script>
<script src="../external/requirejs/require.js"></script>

View File

@ -1455,7 +1455,7 @@ QUnit[ jQuery.find.compile ? "test" : "skip" ]( ":visible/:hidden selectors", fu
// Safari 6-7 and iOS 6-7 report 0 width for br elements
// When newer browsers propagate, re-enable this test
// $br = jQuery( "<br/>" ).appendTo( "#qunit-fixture" );
// ok( $br.is( ":visible" ), "br element is visible" );
// assert.ok( $br.is( ":visible" ), "br element is visible" );
$table = jQuery( "#table" );
$table.html( "<tr><td style='display:none'>cell</td><td>cell</td></tr>" );

View File

@ -330,7 +330,7 @@ QUnit.test( "isFunction", function( assert ) {
assert.ok( !jQuery.isFunction( obj ), "Object Element" );
// Since 1.3, this isn't supported (#2968)
//ok( jQuery.isFunction(obj.getAttribute), "getAttribute Function" );
//assert.ok( jQuery.isFunction(obj.getAttribute), "getAttribute Function" );
nodes = document.body.childNodes;
@ -347,7 +347,7 @@ QUnit.test( "isFunction", function( assert ) {
document.body.appendChild( input );
// Since 1.3, this isn't supported (#2968)
//ok( jQuery.isFunction(input.focus), "A default function property" );
//assert.ok( jQuery.isFunction(input.focus), "A default function property" );
document.body.removeChild( input );

15
test/unit/effects.js vendored
View File

@ -1971,36 +1971,37 @@ QUnit.test( "Animation callbacks (#11797)", function( assert ) {
QUnit.test( "Animation callbacks in order (#2292)", function( assert ) {
assert.expect( 9 );
var step = 0,
var done = assert.async(),
step = 0,
dur = 50;
// assert? -> github.com/JamesMGreene/qunit-assert-step
jQuery( "#foo" ).animate( {
width: "5px"
}, {
duration: dur,
start: function() {
assert.step( 1 );
assert.step( "start" );
},
progress: function( anim, p, ms ) {
if ( !( step++ ) ) {
assert.step( 2 );
assert.step( "progress" );
assert.strictEqual( p, 0, "first progress callback: progress ratio" );
assert.strictEqual( ms, dur, "first progress callback: remaining ms" );
} else {
assert.step( 3 );
assert.step( "last progress" );
assert.strictEqual( p, 1, "last progress callback: progress ratio" );
assert.strictEqual( ms, 0, "last progress callback: remaining ms" );
}
},
done: function() {
assert.step( 4 );
assert.step( "done" );
},
fail: function() {
assert.ok( false, "Animation failed" );
},
always: function() {
assert.step( 5 );
assert.verifySteps( [ "start", "progress", "last progress", "done" ] );
done();
}
} ).finish();

View File

@ -1840,10 +1840,10 @@ QUnit[
$fixture.html(
[
"<script nomodule>ok( !QUnit.moduleTypeSupported, 'evaluated: nomodule script' );</script>",
"<script nomodule>QUnit.assert.ok( !QUnit.moduleTypeSupported, 'evaluated: nomodule script' );</script>",
"<script nomodule src='" + url( "nomodule.js" ) + "'></script>",
"<div>",
"<script nomodule>ok( !QUnit.moduleTypeSupported, 'evaluated: inner nomodule script' );</script>",
"<script nomodule>QUnit.assert.ok( !QUnit.moduleTypeSupported, 'evaluated: inner nomodule script' );</script>",
"<script nomodule src='" + url( "inner_nomodule.js" ) + "'></script>",
"</div>"
].join( "" )

View File

@ -756,9 +756,11 @@ QUnit.test( "offsetParent", function( assert ) {
assert.equal( header.length, 1, "Only one offsetParent found." );
assert.equal( header[ 0 ], document.documentElement, "The html element is the offsetParent of #qunit." );
jQuery( "#qunit-fixture" ).css( "position", "absolute" );
div = jQuery( "#nothiddendivchild" ).offsetParent();
assert.equal( div.length, 1, "Only one offsetParent found." );
assert.equal( div[ 0 ], document.getElementById( "qunit-fixture" ), "The #qunit-fixture is the offsetParent of #nothiddendivchild." );
jQuery( "#qunit-fixture" ).css( "position", "" );
jQuery( "#nothiddendiv" ).css( "position", "relative" );