diff options
Diffstat (limited to 'external')
-rw-r--r-- | external/qunit-assert-classes/LICENSE.txt | 22 | ||||
-rw-r--r-- | external/qunit-assert-classes/qunit-assert-classes.js | 169 | ||||
-rw-r--r-- | external/qunit-assert-close/MIT-LICENSE.txt | 21 | ||||
-rw-r--r-- | external/qunit-assert-close/qunit-assert-close.js | 182 | ||||
-rw-r--r-- | external/qunit-composite/LICENSE.txt | 36 | ||||
-rw-r--r-- | external/qunit-composite/qunit-composite.css | 47 | ||||
-rw-r--r-- | external/qunit-composite/qunit-composite.js | 228 |
7 files changed, 0 insertions, 705 deletions
diff --git a/external/qunit-assert-classes/LICENSE.txt b/external/qunit-assert-classes/LICENSE.txt deleted file mode 100644 index 938db0368..000000000 --- a/external/qunit-assert-classes/LICENSE.txt +++ /dev/null @@ -1,22 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015 Alexander Schmitz - -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. - diff --git a/external/qunit-assert-classes/qunit-assert-classes.js b/external/qunit-assert-classes/qunit-assert-classes.js deleted file mode 100644 index 93edebf9d..000000000 --- a/external/qunit-assert-classes/qunit-assert-classes.js +++ /dev/null @@ -1,169 +0,0 @@ -( function( factory ) { - if ( typeof define === "function" && define.amd ) { - - // AMD. Register as an anonymous module. - define( [ - "qunit" - ], factory ); - } else { - - // Browser globals - factory( QUnit ); - } -}( function( QUnit ) { - - function inArray( haystack, needle ) { - for ( var i = 0; i < haystack.length; i++ ) { - if ( - ( needle instanceof RegExp && needle.test( haystack[ i ] ) )|| - ( typeof needle === "string" && haystack[ i ] === needle ) - ) { - return true; - } - } - return false; - } - - function check( element, search ) { - var i, classAttribute, elementClassArray, - missing = [], - found = []; - - if ( element.jquery && element.length !== 1 ) { - throw new Error( "Class checks can only be performed on a single element on a collection" ); - } - - element = element.jquery ? element[ 0 ] : element; - classAttribute = element.getAttribute( "class" ); - - if ( classAttribute ) { - elementClassArray = splitClasses( classAttribute ); - if ( search instanceof RegExp ) { - if ( inArray( elementClassArray, search ) ) { - found.push( search ); - } else { - missing.push( search ); - } - } else { - for( i = 0; i < search.length; i++ ) { - if ( !inArray( elementClassArray, search[ i ] ) ) { - missing.push( search[ i ] ); - } else { - found.push( search[ i ] ); - } - } - } - } else { - missing = search; - } - - return { - missing: missing, - found: found, - element: element, - classAttribute: classAttribute - }; - } - - function splitClasses( classes ) { - return classes.match( /\S+/g ) || []; - } - - function pluralize( message, classes ) { - return message + ( classes.length > 1 ? "es" : "" ); - } - - QUnit.extend( QUnit.assert, { - hasClasses: function( element, classes, message ) { - var classArray = splitClasses( classes ), - results = check( element, classArray ); - - message = message || pluralize( "Element must have class", classArray ); - - this.push( !results.missing.length, results.found.join( " " ), classes, message ); - }, - lacksClasses: function( element, classes, message ) { - var classArray = splitClasses( classes ), - results = check( element, classArray ); - - message = message || pluralize( "Element must not have class", classArray ); - - this.push( !results.found.length, results.found.join( " " ), classes, message ); - }, - hasClassesStrict: function( element, classes, message ) { - var result, - classArray = splitClasses( classes ), - results = check( element, classArray ); - - message = message || pluralize( "Element must only have class", classArray ); - - result = !results.missing.length && results.element.getAttribute( "class" ) && - splitClasses( results.element.getAttribute( "class" ) ).length === - results.found.length; - - this.push( result, results.found.join( " " ), classes, message ); - }, - hasClassRegex: function( element, regex, message ) { - var results = check( element, regex ); - - message = message || "Element must have class matching " + regex; - - this.push( !!results.found.length, results.found.join( " " ), regex, message ); - }, - lacksClassRegex: function( element, regex, message ) { - var results = check( element, regex ); - - message = message || "Element must not have class matching " + regex; - - this.push( results.missing.length, results.missing.join( " " ), regex, message ); - }, - hasClassStart: function( element, partialClass, message ) { - var results = check( element, new RegExp( "^" + partialClass ) ); - - message = message || "Element must have class starting with " + partialClass; - - this.push( results.found.length, results.found.join( " " ), partialClass, message ); - }, - lacksClassStart: function( element, partialClass, message ) { - var results = check( element, new RegExp( "^" + partialClass ) ); - - message = message || "Element must not have class starting with " + partialClass; - - this.push( results.missing.length, results.missing.join( " " ), partialClass, message ); - }, - hasClassPartial: function( element, partialClass, message ) { - var results = check( element, new RegExp( partialClass ) ); - - message = message || "Element must have class containing '" + partialClass + "'"; - - this.push( results.found.length, results.found.join( " " ), partialClass, message ); - }, - lacksClassPartial: function( element, partialClass, message ) { - var results = check( element, new RegExp( partialClass ) ); - - message = message || "Element must not have class containing '" + partialClass + "'"; - - this.push( results.missing.length, results.missing.join( " " ), partialClass, message ); - }, - lacksAllClasses: function( element, message ) { - element = element.jquery ? element[ 0 ] : element; - - var classAttribute = element.getAttribute( "class" ) || "", - classes = splitClasses( classAttribute ); - - message = message || "Element must not have any classes"; - - this.push( !classes.length, !classes.length, true, message ); - }, - hasSomeClass: function( element, message ) { - element = element.jquery ? element[ 0 ] : element; - - var classAttribute = element.getAttribute( "class" ) || "", - classes = splitClasses( classAttribute ); - - message = message || "Element must have a class"; - - this.push( classes.length, classes.length, true, message ); - } - }); -} ) ); diff --git a/external/qunit-assert-close/MIT-LICENSE.txt b/external/qunit-assert-close/MIT-LICENSE.txt deleted file mode 100644 index aed5dc97e..000000000 --- a/external/qunit-assert-close/MIT-LICENSE.txt +++ /dev/null @@ -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. diff --git a/external/qunit-assert-close/qunit-assert-close.js b/external/qunit-assert-close/qunit-assert-close.js deleted file mode 100644 index 2eee713a0..000000000 --- a/external/qunit-assert-close/qunit-assert-close.js +++ /dev/null @@ -1,182 +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; - } - - /** - * Checks that the first two arguments are equal, or are numbers close enough to be considered equal - * based on a specified maximum allowable difference. - * - * @example assert.close(3.141, Math.PI, 0.001); - * - * @param Number actual - * @param Number expected - * @param Number maxDifference (the maximum inclusive difference allowed between the actual and expected numbers) - * @param String message (optional) - */ - function close(actual, expected, maxDifference, message) { - var actualDiff = (actual === expected) ? 0 : Math.abs(actual - expected), - result = actualDiff <= maxDifference, - pushContext = _getPushContext(this); - - message = message || (actual + " should be within " + maxDifference + " (inclusive) of " + expected + (result ? "" : ". Actual: " + actualDiff)); - - pushContext.push(result, actual, expected, message); - } - - - /** - * Checks that the first two arguments are equal, or are numbers close enough to be considered equal - * based on a specified maximum allowable difference percentage. - * - * @example assert.close.percent(155, 150, 3.4); // Difference is ~3.33% - * - * @param Number actual - * @param Number expected - * @param Number maxPercentDifference (the maximum inclusive difference percentage allowed between the actual and expected numbers) - * @param String message (optional) - */ - close.percent = function closePercent(actual, expected, maxPercentDifference, message) { - var actualDiff, result, - pushContext = _getPushContext(this); - - if (actual === expected) { - actualDiff = 0; - result = actualDiff <= maxPercentDifference; - } - else if (actual !== 0 && expected !== 0 && expected !== Infinity && expected !== -Infinity) { - actualDiff = Math.abs(100 * (actual - expected) / expected); - result = actualDiff <= maxPercentDifference; - } - else { - // Dividing by zero (0)! Should return `false` unless the max percentage was `Infinity` - actualDiff = Infinity; - result = maxPercentDifference === Infinity; - } - message = message || (actual + " should be within " + maxPercentDifference + "% (inclusive) of " + expected + (result ? "" : ". Actual: " + actualDiff + "%")); - - pushContext.push(result, actual, expected, message); - }; - - - /** - * Checks that the first two arguments are numbers with differences greater than the specified - * minimum difference. - * - * @example assert.notClose(3.1, Math.PI, 0.001); - * - * @param Number actual - * @param Number expected - * @param Number minDifference (the minimum exclusive difference allowed between the actual and expected numbers) - * @param String message (optional) - */ - function notClose(actual, expected, minDifference, message) { - var actualDiff = Math.abs(actual - expected), - result = actualDiff > minDifference, - pushContext = _getPushContext(this); - - message = message || (actual + " should not be within " + minDifference + " (exclusive) of " + expected + (result ? "" : ". Actual: " + actualDiff)); - - pushContext.push(result, actual, expected, message); - } - - - /** - * Checks that the first two arguments are numbers with differences greater than the specified - * minimum difference percentage. - * - * @example assert.notClose.percent(156, 150, 3.5); // Difference is 4.0% - * - * @param Number actual - * @param Number expected - * @param Number minPercentDifference (the minimum exclusive difference percentage allowed between the actual and expected numbers) - * @param String message (optional) - */ - notClose.percent = function notClosePercent(actual, expected, minPercentDifference, message) { - var actualDiff, result, - pushContext = _getPushContext(this); - - if (actual === expected) { - actualDiff = 0; - result = actualDiff > minPercentDifference; - } - else if (actual !== 0 && expected !== 0 && expected !== Infinity && expected !== -Infinity) { - actualDiff = Math.abs(100 * (actual - expected) / expected); - result = actualDiff > minPercentDifference; - } - else { - // Dividing by zero (0)! Should only return `true` if the min percentage was `Infinity` - actualDiff = Infinity; - result = minPercentDifference !== Infinity; - } - message = message || (actual + " should not be within " + minPercentDifference + "% (exclusive) of " + expected + (result ? "" : ". Actual: " + actualDiff + "%")); - - pushContext.push(result, actual, expected, message); - }; - - - var api = { - close: close, - notClose: notClose, - closePercent: close.percent, - notClosePercent: notClose.percent - }; - - QUnit.extend(QUnit.assert, api); - - return api; -})); diff --git a/external/qunit-composite/LICENSE.txt b/external/qunit-composite/LICENSE.txt deleted file mode 100644 index 155d8e869..000000000 --- a/external/qunit-composite/LICENSE.txt +++ /dev/null @@ -1,36 +0,0 @@ -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 -available at https://github.com/JamesMGreene/qunit-composite - -The following license applies to all parts of this software except as -documented below: - -==== - -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. - -==== - -All files located in the node_modules directory are externally -maintained libraries used by this software which have their own -licenses; we recommend you read them, as their terms may differ from the -terms above. diff --git a/external/qunit-composite/qunit-composite.css b/external/qunit-composite/qunit-composite.css deleted file mode 100644 index a5d06ce77..000000000 --- a/external/qunit-composite/qunit-composite.css +++ /dev/null @@ -1,47 +0,0 @@ -.qunit-composite-suite { - position: fixed; - bottom: 0; - left: 0; - - margin: 0; - padding: 0; - border-width: 1px 0 0; - height: 45%; - width: 100%; - - background: #fff; -} - -#qunit-testsuites { - margin: 0; - padding: 0.5em 1.0em; - font-family: "Helvetica Neue Light","HelveticaNeue-Light","Helvetica Neue",Calibri,Helvetica,Arial,sans-serif; - font-size: small; - background-color: #d2e0e6; - border-bottom: 1px solid #fff; -} - -#qunit-testsuites a { - color: #00c; - text-decoration: none; -} - -#qunit-testsuites a:hover { - text-decoration: underline; -} - -#qunit-testsuites > li { - display: inline-block; -} - -#qunit-testsuites > li:first-child::before { - content: "Suites: "; -} - -#qunit-testsuites > li + li::before { - content: "|\a0"; -} - -#qunit-testsuites > li::after { - content: "\a0"; -} diff --git a/external/qunit-composite/qunit-composite.js b/external/qunit-composite/qunit-composite.js deleted file mode 100644 index 8e4fda45a..000000000 --- a/external/qunit-composite/qunit-composite.js +++ /dev/null @@ -1,228 +0,0 @@ -/** - * QUnit Composite - * - * https://github.com/JamesMGreene/qunit-composite - * - * Copyright jQuery Foundation and other contributors - * Released under the MIT license. - * https://jquery.org/license/ - */ -(function( factory ) { - if ( typeof define === "function" && define.amd ) { - define( [ "qunit" ], factory ); - } else { - factory( QUnit ); - } -}(function( QUnit ) { -var iframe, hasBound, resumeTests, suiteAssert, - modules = 1, - executingComposite = false; - -function hasClass( elem, name ) { - return ( " " + elem.className + " " ).indexOf( " " + name + " " ) > -1; -} - -function addClass( elem, name ) { - if ( !hasClass( elem, name ) ) { - elem.className += ( elem.className ? " " : "" ) + name; - } -} - -function addEvent( elem, type, fn ) { - if ( elem.addEventListener ) { - // Standards-based browsers - elem.addEventListener( type, fn, false ); - } else if ( elem.attachEvent ) { - // support: IE <9 - elem.attachEvent( "on" + type, fn ); - } -} - -function runSuite( suite ) { - var path; - - if ( QUnit.is( "object", suite ) ) { - path = suite.path; - suite = suite.name; - } else { - path = suite; - } - - QUnit.test( suite, function( assert ) { - resumeTests = assert.async(); - suiteAssert = assert; - iframe.setAttribute( "src", path ); - // QUnit.start is called from the child iframe's QUnit.done hook. - }); -} - -function initIframe() { - var iframeWin, - body = document.body; - - function onIframeLoad() { - var moduleName, testName, - count = 0; - - if ( !iframe.src ) { - return; - } - - // Deal with QUnit being loaded asynchronously via AMD - if ( !iframeWin.QUnit && iframeWin.define && iframeWin.define.amd ) { - return iframeWin.require( [ "qunit" ], onIframeLoad ); - } - - iframeWin.QUnit.moduleStart(function( data ) { - // Capture module name for messages - moduleName = data.name; - }); - - iframeWin.QUnit.testStart(function( data ) { - // Capture test name for messages - testName = data.name; - }); - iframeWin.QUnit.testDone(function() { - testName = undefined; - }); - - iframeWin.QUnit.log(function( data ) { - if (testName === undefined) { - return; - } - // Pass all test details through to the main page - var message = ( moduleName ? moduleName + ": " : "" ) + testName + ": " + ( data.message || ( data.result ? "okay" : "failed" ) ); - suiteAssert.expect( ++count ); - suiteAssert.push( data.result, data.actual, data.expected, message ); - }); - - // Continue the outer test when the iframe's test is done - iframeWin.QUnit.done(function() { - resumeTests(); - }); - } - - iframe = document.createElement( "iframe" ); - iframe.className = "qunit-composite-suite"; - body.appendChild( iframe ); - - addEvent( iframe, "load", onIframeLoad ); - - iframeWin = iframe.contentWindow; -} - -function appendSuitesToHeader( suites ) { - var i, suitesLen, suite, path, name, suitesEl, testResultEl, - newSuiteListItemEl, newSuiteLinkEl; - - suitesEl = document.getElementById("qunit-testsuites"); - - if (!suitesEl) { - testResultEl = document.getElementById("qunit-testresult"); - - if (!testResultEl) { - // QUnit has not been set up yet. Defer until QUnit is ready. - QUnit.begin(function () { - appendSuitesToHeader(suites); - }); - return; - } - - suitesEl = document.createElement("ul"); - suitesEl.id = "qunit-testsuites"; - testResultEl.parentNode.insertBefore(suitesEl, testResultEl); - } - - for (i = 0, suitesLen = suites.length; i < suitesLen; ++i) { - suite = suites[i]; - newSuiteLinkEl = document.createElement("a"); - newSuiteLinkEl.innerHTML = suite.name || suite; - newSuiteLinkEl.href = suite.path || suite; - - newSuiteListItemEl = document.createElement("li"); - newSuiteListItemEl.appendChild(newSuiteLinkEl); - - suitesEl.appendChild(newSuiteListItemEl); - } -} - -/** - * @param {string} [name] Module name to group these test suites. - * @param {Array} suites List of suites where each suite - * may either be a string (path to the html test page), - * or an object with a path and name property. - */ -QUnit.testSuites = function( name, suites ) { - var i, suitesLen; - - if ( arguments.length === 1 ) { - suites = name; - name = "Composition #" + modules++; - } - suitesLen = suites.length; - - appendSuitesToHeader(suites); - - if ( !hasBound ) { - hasBound = true; - QUnit.begin( initIframe ); - - // TODO: Would be better to use something like QUnit.once( 'moduleDone' ) - // after the last test suite. - QUnit.moduleDone( function () { - executingComposite = false; - } ); - - QUnit.done(function() { - iframe.style.display = "none"; - }); - } - - QUnit.module( name, { - beforeEach: function () { - executingComposite = true; - } - }); - - for ( i = 0; i < suitesLen; i++ ) { - runSuite( suites[ i ] ); - } -}; - -QUnit.testDone(function( data ) { - if ( !executingComposite ) { - return; - } - - var i, len, - testId = data.testId, - current = document.getElementById( "qunit-test-output-" + testId ), - children = current && current.children, - src = iframe.src; - - if (!(current && children)) { - return; - } - - addEvent( current, "dblclick", function( e ) { - var target = e && e.target ? e.target : window.event.srcElement; - if ( target.nodeName.toLowerCase() === "span" || target.nodeName.toLowerCase() === "b" ) { - target = target.parentNode; - } - if ( window.location && target.nodeName.toLowerCase() === "strong" ) { - window.location = src; - } - }); - - // Undo QUnit's auto-expansion for bad tests - for ( i = 0, len = children.length; i < len; i++ ) { - if ( children[ i ].nodeName.toLowerCase() === "ol" ) { - addClass( children[ i ], "qunit-collapsed" ); - } - } - - // Update Rerun link to point to the standalone test suite page - current.getElementsByTagName( "a" )[ 0 ].href = src; -}); - -})); |