/*!
- * 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';
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"];
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);
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,
result = false;
}
- return this.pushResult({
+ this.pushResult({
result: result,
message: assertionMessage
});
}
}
- 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
}
}
- var focused = false;
var QUnit = {};
var globalSuite = new SuiteReport();
// it since each module has a suiteReport associated with it.
config.currentModule.suiteReport = globalSuite;
- var moduleStack = [];
var globalStartCalled = false;
var runStarted = false;
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,
ProcessingQueue.advance();
}
- function setHookFunction(module, hookName) {
- return function setHook(callback) {
- module.hooks[hookName].push(callback);
- };
- }
-
exportQUnit(QUnit);
(function () {
dirty = false;
moduleSearch.id = "qunit-modulefilter-search";
+ moduleSearch.autocomplete = "off";
addEvent(moduleSearch, "input", searchInput);
addEvent(moduleSearch, "input", searchFocus);
addEvent(moduleSearch, "focus", searchFocus);
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) {