|
1 | 1 | /*!
|
2 |
| - * QUnit 2.4.0 |
| 2 | + * QUnit 2.4.1 |
3 | 3 | * https://qunitjs.com/
|
4 | 4 | *
|
5 | 5 | * Copyright jQuery Foundation and other contributors
|
6 | 6 | * Released under the MIT license
|
7 | 7 | * https://jquery.org/license
|
8 | 8 | *
|
9 |
| - * Date: 2017-07-08T15:20Z |
| 9 | + * Date: 2017-10-22T05:12Z |
10 | 10 | */
|
11 | 11 | (function (global$1) {
|
12 | 12 | 'use strict';
|
13 | 13 |
|
14 |
| - global$1 = global$1 && 'default' in global$1 ? global$1['default'] : global$1; |
| 14 | + global$1 = 'default' in global$1 ? global$1['default'] : global$1; |
15 | 15 |
|
16 | 16 | var window = global$1.window;
|
17 | 17 | var self$1 = global$1.self;
|
|
1388 | 1388 | this.async = false;
|
1389 | 1389 | this.expected = 0;
|
1390 | 1390 | } else {
|
| 1391 | + if (typeof this.callback !== "function") { |
| 1392 | + var method = this.todo ? "todo" : "test"; |
| 1393 | + |
| 1394 | + // eslint-disable-next-line max-len |
| 1395 | + throw new TypeError("You must provide a function as a test callback to QUnit." + method + "(\"" + settings.testName + "\")"); |
| 1396 | + } |
| 1397 | + |
1391 | 1398 | this.assert = new Assert(this);
|
1392 | 1399 | }
|
1393 | 1400 | }
|
|
1697 | 1704 | result: resultInfo.result,
|
1698 | 1705 | message: resultInfo.message,
|
1699 | 1706 | actual: resultInfo.actual,
|
1700 |
| - expected: resultInfo.expected, |
1701 | 1707 | testId: this.testId,
|
1702 | 1708 | negative: resultInfo.negative || false,
|
1703 | 1709 | runtime: now() - this.started,
|
1704 | 1710 | todo: !!this.todo
|
1705 | 1711 | };
|
1706 | 1712 |
|
| 1713 | + if (hasOwn.call(resultInfo, "expected")) { |
| 1714 | + details.expected = resultInfo.expected; |
| 1715 | + } |
| 1716 | + |
1707 | 1717 | if (!resultInfo.result) {
|
1708 | 1718 | source = resultInfo.source || sourceFromStacktrace();
|
1709 | 1719 |
|
|
1729 | 1739 | result: false,
|
1730 | 1740 | message: message || "error",
|
1731 | 1741 | actual: actual || null,
|
1732 |
| - expected: null, |
1733 | 1742 | source: source
|
1734 | 1743 | });
|
1735 | 1744 | },
|
|
2650 | 2659 | QUnit.isLocal = !(defined.document && window.location.protocol !== "file:");
|
2651 | 2660 |
|
2652 | 2661 | // Expose the current QUnit version
|
2653 |
| - QUnit.version = "2.4.0"; |
| 2662 | + QUnit.version = "2.4.1"; |
2654 | 2663 |
|
2655 | 2664 | function createModule(name, testEnvironment, modifiers) {
|
2656 | 2665 | var parentModule = moduleStack.length ? moduleStack.slice(-1)[0] : null;
|
|
3284 | 3293 | // Skip inherited or undefined properties
|
3285 | 3294 | if (hasOwn.call(params, key) && params[key] !== undefined) {
|
3286 | 3295 |
|
3287 |
| - // Output a parameter for each value of this key (but usually just one) |
| 3296 | + // Output a parameter for each value of this key |
| 3297 | + // (but usually just one) |
3288 | 3298 | arrValue = [].concat(params[key]);
|
3289 | 3299 | for (i = 0; i < arrValue.length; i++) {
|
3290 | 3300 | querystring += encodeURIComponent(key);
|
|
3705 | 3715 | if (config.altertitle && document$$1.title) {
|
3706 | 3716 |
|
3707 | 3717 | // Show ✖ for good, ✔ for bad suite result in title
|
3708 |
| - // use escape sequences in case file gets loaded with non-utf-8-charset |
| 3718 | + // use escape sequences in case file gets loaded with non-utf-8 |
| 3719 | + // charset |
3709 | 3720 | document$$1.title = [stats.failedTests ? "\u2716" : "\u2714", document$$1.title.replace(/^[\u2714\u2716] /i, "")].join(" ");
|
3710 | 3721 | }
|
3711 | 3722 |
|
|
3743 | 3754 | if (running) {
|
3744 | 3755 | bad = QUnit.config.reorder && details.previousFailure;
|
3745 | 3756 |
|
3746 |
| - running.innerHTML = (bad ? "Rerunning previously failed test: <br />" : "Running: <br />") + getNameHtml(details.name, details.module); |
| 3757 | + running.innerHTML = [bad ? "Rerunning previously failed test: <br />" : "Running: <br />", getNameHtml(details.name, details.module)].join(""); |
3747 | 3758 | }
|
3748 | 3759 | });
|
3749 | 3760 |
|
|
4874 | 4885 | line = text.substring(lineStart, lineEnd + 1);
|
4875 | 4886 | lineStart = lineEnd + 1;
|
4876 | 4887 |
|
4877 |
| - if (lineHash.hasOwnProperty ? lineHash.hasOwnProperty(line) : lineHash[line] !== undefined) { |
| 4888 | + var lineHashExists = lineHash.hasOwnProperty ? lineHash.hasOwnProperty(line) : lineHash[line] !== undefined; |
| 4889 | + |
| 4890 | + if (lineHashExists) { |
4878 | 4891 | chars += String.fromCharCode(lineHash[line]);
|
4879 | 4892 | } else {
|
4880 | 4893 | chars += String.fromCharCode(lineArrayLength);
|
|
0 commit comments