From a6242eff164efc04c109a9e8fca9e1ea346f1556 Mon Sep 17 00:00:00 2001 From: "James D. Forrester" Date: Wed, 5 Sep 2018 15:51:03 -0700 Subject: [PATCH] Bump qunit from 2.6.0 to 2.6.2 Change-Id: Id7f47eee423c2fc1289f468c6622b952814d8912 --- RELEASE-NOTES-1.32 | 2 +- maintenance/resources/foreign-resources.yaml | 8 +- package.json | 2 +- resources/lib/qunitjs/qunit.css | 4 +- resources/lib/qunitjs/qunit.js | 523 +++++++++---------- 5 files changed, 267 insertions(+), 272 deletions(-) diff --git a/RELEASE-NOTES-1.32 b/RELEASE-NOTES-1.32 index 0dca8f13d5..be91861255 100644 --- a/RELEASE-NOTES-1.32 +++ b/RELEASE-NOTES-1.32 @@ -97,7 +97,7 @@ production. * … ==== Changed external libraries ==== -* Updated qunitjs from 2.4.0 to 2.6.0. +* Updated qunitjs from 2.4.0 to 2.6.2. * Updated wikimedia/scoped-callback from 1.0.0 to 2.0.0. ** ScopedCallback objects can no longer be serialized. * Updated wikimedia/wrappedstring from 2.3.0 to 3.0.1. diff --git a/maintenance/resources/foreign-resources.yaml b/maintenance/resources/foreign-resources.yaml index 25086d4422..930696d500 100644 --- a/maintenance/resources/foreign-resources.yaml +++ b/maintenance/resources/foreign-resources.yaml @@ -82,11 +82,11 @@ qunitjs: # Integrity from link modals at https://code.jquery.com/qunit/ files: qunit.js: - src: https://code.jquery.com/qunit/qunit-2.6.0.js - integrity: sha256-QdI40P4EEDzPRIS0mktlE0sSyoXCnOs8fB4OSmy+VxI= + src: https://code.jquery.com/qunit/qunit-2.6.2.js + integrity: sha256-72OhbBvECs6Z5vG0GfPqiyYvTf8vhdEVHKQcacIcIeM= qunit.css: - src: https://code.jquery.com/qunit/qunit-2.6.0.css - integrity: sha256-F4O5nugrHEEjfO0tfu/LKnSRFKctZ9Rdmi1oj22UD1s= + src: https://code.jquery.com/qunit/qunit-2.6.2.css + integrity: sha256-qpkurjTvVTJJCSpMABcvF4IlYUJkd8saxiHgUQpEjX8= CLDRPluralRuleParser: type: file src: https://raw.githubusercontent.com/santhoshtr/CLDRPluralRuleParser/v1.1.3/src/CLDRPluralRuleParser.js diff --git a/package.json b/package.json index 5fa6961674..4f7523e7e4 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "karma-mocha-reporter": "2.2.5", "karma-qunit": "2.1.0", "postcss-less": "2.0.0", - "qunit": "2.6.0", + "qunit": "2.6.2", "stylelint": "9.2.0", "stylelint-config-wikimedia": "0.4.3", "wdio-junit-reporter": "0.2.0", diff --git a/resources/lib/qunitjs/qunit.css b/resources/lib/qunitjs/qunit.css index 859544eb22..a7002a07a5 100644 --- a/resources/lib/qunitjs/qunit.css +++ b/resources/lib/qunitjs/qunit.css @@ -1,12 +1,12 @@ /*! - * QUnit 2.6.0 + * QUnit 2.6.2 * https://qunitjs.com/ * * Copyright jQuery Foundation and other contributors * Released under the MIT license * https://jquery.org/license * - * Date: 2018-03-27T02:18Z + * Date: 2018-08-19T19:37Z */ /** Font Family and Sizes */ diff --git a/resources/lib/qunitjs/qunit.js b/resources/lib/qunitjs/qunit.js index d7b22ddf84..aea68baffa 100644 --- a/resources/lib/qunitjs/qunit.js +++ b/resources/lib/qunitjs/qunit.js @@ -1,12 +1,12 @@ /*! - * QUnit 2.6.0 + * QUnit 2.6.2 * https://qunitjs.com/ * * Copyright jQuery Foundation and other contributors * Released under the MIT license * https://jquery.org/license * - * Date: 2018-03-27T02:18Z + * Date: 2018-08-19T19:37Z */ (function (global$1) { 'use strict'; @@ -950,6 +950,250 @@ return dump; })(); + var SuiteReport = function () { + function SuiteReport(name, parentSuite) { + classCallCheck(this, SuiteReport); + + this.name = name; + this.fullName = parentSuite ? parentSuite.fullName.concat(name) : []; + + this.tests = []; + this.childSuites = []; + + if (parentSuite) { + parentSuite.pushChildSuite(this); + } + } + + createClass(SuiteReport, [{ + key: "start", + value: function start(recordTime) { + if (recordTime) { + this._startTime = Date.now(); + } + + return { + name: this.name, + fullName: this.fullName.slice(), + tests: this.tests.map(function (test) { + return test.start(); + }), + childSuites: this.childSuites.map(function (suite) { + return suite.start(); + }), + testCounts: { + total: this.getTestCounts().total + } + }; + } + }, { + key: "end", + value: function end(recordTime) { + if (recordTime) { + this._endTime = Date.now(); + } + + return { + name: this.name, + fullName: this.fullName.slice(), + tests: this.tests.map(function (test) { + return test.end(); + }), + childSuites: this.childSuites.map(function (suite) { + return suite.end(); + }), + testCounts: this.getTestCounts(), + runtime: this.getRuntime(), + status: this.getStatus() + }; + } + }, { + key: "pushChildSuite", + value: function pushChildSuite(suite) { + this.childSuites.push(suite); + } + }, { + key: "pushTest", + value: function pushTest(test) { + this.tests.push(test); + } + }, { + key: "getRuntime", + value: function getRuntime() { + return this._endTime - this._startTime; + } + }, { + key: "getTestCounts", + value: function getTestCounts() { + var counts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { passed: 0, failed: 0, skipped: 0, todo: 0, total: 0 }; + + counts = this.tests.reduce(function (counts, test) { + if (test.valid) { + counts[test.getStatus()]++; + counts.total++; + } + + return counts; + }, counts); + + return this.childSuites.reduce(function (counts, suite) { + return suite.getTestCounts(counts); + }, counts); + } + }, { + key: "getStatus", + value: function getStatus() { + var _getTestCounts = this.getTestCounts(), + total = _getTestCounts.total, + failed = _getTestCounts.failed, + skipped = _getTestCounts.skipped, + todo = _getTestCounts.todo; + + if (failed) { + return "failed"; + } else { + if (skipped === total) { + return "skipped"; + } else if (todo === total) { + return "todo"; + } else { + return "passed"; + } + } + } + }]); + return SuiteReport; + }(); + + var focused = false; + + var moduleStack = []; + + function createModule(name, testEnvironment, modifiers) { + var parentModule = moduleStack.length ? moduleStack.slice(-1)[0] : null; + var moduleName = parentModule !== null ? [parentModule.name, name].join(" > ") : name; + var parentSuite = parentModule ? parentModule.suiteReport : globalSuite; + + var skip = parentModule !== null && parentModule.skip || modifiers.skip; + var todo = parentModule !== null && parentModule.todo || modifiers.todo; + + var module = { + name: moduleName, + parentModule: parentModule, + tests: [], + moduleId: generateHash(moduleName), + testsRun: 0, + unskippedTestsRun: 0, + childModules: [], + suiteReport: new SuiteReport(name, parentSuite), + + // Pass along `skip` and `todo` properties from parent module, in case + // there is one, to childs. And use own otherwise. + // This property will be used to mark own tests and tests of child suites + // as either `skipped` or `todo`. + skip: skip, + todo: skip ? false : todo + }; + + var env = {}; + if (parentModule) { + parentModule.childModules.push(module); + extend(env, parentModule.testEnvironment); + } + extend(env, testEnvironment); + module.testEnvironment = env; + + config.modules.push(module); + return module; + } + + function processModule(name, options, executeNow) { + var modifiers = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; + + if (objectType(options) === "function") { + executeNow = options; + options = undefined; + } + + var module = createModule(name, options, modifiers); + + // Move any hooks to a 'hooks' object + var testEnvironment = module.testEnvironment; + var hooks = module.hooks = {}; + + setHookFromEnvironment(hooks, testEnvironment, "before"); + setHookFromEnvironment(hooks, testEnvironment, "beforeEach"); + setHookFromEnvironment(hooks, testEnvironment, "afterEach"); + setHookFromEnvironment(hooks, testEnvironment, "after"); + + var moduleFns = { + before: setHookFunction(module, "before"), + beforeEach: setHookFunction(module, "beforeEach"), + afterEach: setHookFunction(module, "afterEach"), + after: setHookFunction(module, "after") + }; + + var currentModule = config.currentModule; + if (objectType(executeNow) === "function") { + moduleStack.push(module); + config.currentModule = module; + executeNow.call(module.testEnvironment, moduleFns); + moduleStack.pop(); + module = module.parentModule || currentModule; + } + + config.currentModule = module; + + function setHookFromEnvironment(hooks, environment, name) { + var potentialHook = environment[name]; + hooks[name] = typeof potentialHook === "function" ? [potentialHook] : []; + delete environment[name]; + } + + function setHookFunction(module, hookName) { + return function setHook(callback) { + module.hooks[hookName].push(callback); + }; + } + } + + function module$1(name, options, executeNow) { + if (focused) { + return; + } + + processModule(name, options, executeNow); + } + + module$1.only = function () { + if (focused) { + return; + } + + config.modules.length = 0; + config.queue.length = 0; + + module$1.apply(undefined, arguments); + + focused = true; + }; + + module$1.skip = function (name, options, executeNow) { + if (focused) { + return; + } + + processModule(name, options, executeNow, { skip: true }); + }; + + module$1.todo = function (name, options, executeNow) { + if (focused) { + return; + } + + processModule(name, options, executeNow, { todo: true }); + }; + var LISTENERS = Object.create(null); var SUPPORTED_EVENTS = ["runStart", "suiteStart", "testStart", "assertion", "testEnd", "suiteEnd", "runEnd"]; @@ -1609,6 +1853,10 @@ finish: function finish() { config.current = this; + // Release the test callback to ensure that anything referenced has been + // released to be garbage collected. + this.callback = undefined; + if (this.steps.length) { var stepsList = this.steps.join(", "); this.pushFailure("Expected assert.verifySteps() to be called before end of test " + ("after using assert.step(). Unverified steps: " + stepsList), this.stack); @@ -1693,6 +1941,11 @@ config.current = undefined; function logSuiteEnd(module) { + + // Reset `module.hooks` to ensure that anything referenced in these hooks + // has been released to be garbage collected. + module.hooks = {}; + emit("suiteEnd", module.suiteReport.end(true)); runLoggingCallbacks("moduleDone", { name: module.name, @@ -2210,7 +2463,7 @@ result = false; } - return this.pushResult({ + this.pushResult({ result: result, message: assertionMessage }); @@ -2672,121 +2925,6 @@ } } - var SuiteReport = function () { - function SuiteReport(name, parentSuite) { - classCallCheck(this, SuiteReport); - - this.name = name; - this.fullName = parentSuite ? parentSuite.fullName.concat(name) : []; - - this.tests = []; - this.childSuites = []; - - if (parentSuite) { - parentSuite.pushChildSuite(this); - } - } - - createClass(SuiteReport, [{ - key: "start", - value: function start(recordTime) { - if (recordTime) { - this._startTime = Date.now(); - } - - return { - name: this.name, - fullName: this.fullName.slice(), - tests: this.tests.map(function (test) { - return test.start(); - }), - childSuites: this.childSuites.map(function (suite) { - return suite.start(); - }), - testCounts: { - total: this.getTestCounts().total - } - }; - } - }, { - key: "end", - value: function end(recordTime) { - if (recordTime) { - this._endTime = Date.now(); - } - - return { - name: this.name, - fullName: this.fullName.slice(), - tests: this.tests.map(function (test) { - return test.end(); - }), - childSuites: this.childSuites.map(function (suite) { - return suite.end(); - }), - testCounts: this.getTestCounts(), - runtime: this.getRuntime(), - status: this.getStatus() - }; - } - }, { - key: "pushChildSuite", - value: function pushChildSuite(suite) { - this.childSuites.push(suite); - } - }, { - key: "pushTest", - value: function pushTest(test) { - this.tests.push(test); - } - }, { - key: "getRuntime", - value: function getRuntime() { - return this._endTime - this._startTime; - } - }, { - key: "getTestCounts", - value: function getTestCounts() { - var counts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { passed: 0, failed: 0, skipped: 0, todo: 0, total: 0 }; - - counts = this.tests.reduce(function (counts, test) { - if (test.valid) { - counts[test.getStatus()]++; - counts.total++; - } - - return counts; - }, counts); - - return this.childSuites.reduce(function (counts, suite) { - return suite.getTestCounts(counts); - }, counts); - } - }, { - key: "getStatus", - value: function getStatus() { - var _getTestCounts = this.getTestCounts(), - total = _getTestCounts.total, - failed = _getTestCounts.failed, - skipped = _getTestCounts.skipped, - todo = _getTestCounts.todo; - - if (failed) { - return "failed"; - } else { - if (skipped === total) { - return "skipped"; - } else if (todo === total) { - return "todo"; - } else { - return "passed"; - } - } - } - }]); - return SuiteReport; - }(); - // Handle an unhandled exception. By convention, returns true if further // error handling should be suppressed and false otherwise. // In this case, we will only suppress further error handling if the @@ -2829,7 +2967,6 @@ } } - var focused = false; var QUnit = {}; var globalSuite = new SuiteReport(); @@ -2838,7 +2975,6 @@ // it since each module has a suiteReport associated with it. config.currentModule.suiteReport = globalSuite; - var moduleStack = []; var globalStartCalled = false; var runStarted = false; @@ -2846,143 +2982,7 @@ QUnit.isLocal = !(defined.document && window.location.protocol !== "file:"); // Expose the current QUnit version - QUnit.version = "2.6.0"; - - function createModule(name, testEnvironment, modifiers) { - var parentModule = moduleStack.length ? moduleStack.slice(-1)[0] : null; - var moduleName = parentModule !== null ? [parentModule.name, name].join(" > ") : name; - var parentSuite = parentModule ? parentModule.suiteReport : globalSuite; - - var skip$$1 = parentModule !== null && parentModule.skip || modifiers.skip; - var todo$$1 = parentModule !== null && parentModule.todo || modifiers.todo; - - var module = { - name: moduleName, - parentModule: parentModule, - tests: [], - moduleId: generateHash(moduleName), - testsRun: 0, - unskippedTestsRun: 0, - childModules: [], - suiteReport: new SuiteReport(name, parentSuite), - - // Pass along `skip` and `todo` properties from parent module, in case - // there is one, to childs. And use own otherwise. - // This property will be used to mark own tests and tests of child suites - // as either `skipped` or `todo`. - skip: skip$$1, - todo: skip$$1 ? false : todo$$1 - }; - - var env = {}; - if (parentModule) { - parentModule.childModules.push(module); - extend(env, parentModule.testEnvironment); - } - extend(env, testEnvironment); - module.testEnvironment = env; - - config.modules.push(module); - return module; - } - - function processModule(name, options, executeNow) { - var modifiers = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; - - var module = createModule(name, options, modifiers); - - // Move any hooks to a 'hooks' object - var testEnvironment = module.testEnvironment; - var hooks = module.hooks = {}; - - setHookFromEnvironment(hooks, testEnvironment, "before"); - setHookFromEnvironment(hooks, testEnvironment, "beforeEach"); - setHookFromEnvironment(hooks, testEnvironment, "afterEach"); - setHookFromEnvironment(hooks, testEnvironment, "after"); - - function setHookFromEnvironment(hooks, environment, name) { - var potentialHook = environment[name]; - hooks[name] = typeof potentialHook === "function" ? [potentialHook] : []; - delete environment[name]; - } - - var moduleFns = { - before: setHookFunction(module, "before"), - beforeEach: setHookFunction(module, "beforeEach"), - afterEach: setHookFunction(module, "afterEach"), - after: setHookFunction(module, "after") - }; - - var currentModule = config.currentModule; - if (objectType(executeNow) === "function") { - moduleStack.push(module); - config.currentModule = module; - executeNow.call(module.testEnvironment, moduleFns); - moduleStack.pop(); - module = module.parentModule || currentModule; - } - - config.currentModule = module; - } - - // TODO: extract this to a new file alongside its related functions - function module$1(name, options, executeNow) { - if (focused) { - return; - } - - if (arguments.length === 2) { - if (objectType(options) === "function") { - executeNow = options; - options = undefined; - } - } - - processModule(name, options, executeNow); - } - - module$1.only = function () { - if (focused) { - return; - } - - config.modules.length = 0; - config.queue.length = 0; - - module$1.apply(undefined, arguments); - - focused = true; - }; - - module$1.skip = function (name, options, executeNow) { - if (focused) { - return; - } - - if (arguments.length === 2) { - if (objectType(options) === "function") { - executeNow = options; - options = undefined; - } - } - - processModule(name, options, executeNow, { skip: true }); - }; - - module$1.todo = function (name, options, executeNow) { - if (focused) { - return; - } - - if (arguments.length === 2) { - if (objectType(options) === "function") { - executeNow = options; - options = undefined; - } - } - - processModule(name, options, executeNow, { todo: true }); - }; + QUnit.version = "2.6.2"; extend(QUnit, { on: on, @@ -3126,12 +3126,6 @@ ProcessingQueue.advance(); } - function setHookFunction(module, hookName) { - return function setHook(callback) { - module.hooks[hookName].push(callback); - }; - } - exportQUnit(QUnit); (function () { @@ -3603,6 +3597,7 @@ dirty = false; moduleSearch.id = "qunit-modulefilter-search"; + moduleSearch.autocomplete = "off"; addEvent(moduleSearch, "input", searchInput); addEvent(moduleSearch, "input", searchFocus); addEvent(moduleSearch, "focus", searchFocus); @@ -3959,7 +3954,7 @@ function stripHtml(string) { // Strip tags, html entity and whitespaces - return string.replace(/<\/?[^>]+(>|$)/g, "").replace(/\"/g, "").replace(/\s+/g, ""); + return string.replace(/<\/?[^>]+(>|$)/g, "").replace(/"/g, "").replace(/\s+/g, ""); } QUnit.log(function (details) { -- 2.20.1