1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-21 04:41:36 +02:00

Update dependencies.

This commit is contained in:
Bardi Harborow
2017-07-15 09:23:36 +00:00
parent 62a4796268
commit d35020cee8
8 changed files with 253 additions and 8285 deletions

View File

@@ -1,12 +1,12 @@
/*!
* QUnit 2.3.3
* QUnit 2.4.0
* https://qunitjs.com/
*
* Copyright jQuery Foundation and other contributors
* Released under the MIT license
* https://jquery.org/license
*
* Date: 2017-06-02T14:07Z
* Date: 2017-07-08T15:20Z
*/
/** Font Family and Sizes */
@@ -433,4 +433,4 @@
left: -10000px;
width: 1000px;
height: 1000px;
}
}

View File

@@ -1,17 +1,17 @@
/*!
* QUnit 2.3.3
* QUnit 2.4.0
* https://qunitjs.com/
*
* Copyright jQuery Foundation and other contributors
* Released under the MIT license
* https://jquery.org/license
*
* Date: 2017-06-02T14:07Z
* Date: 2017-07-08T15:20Z
*/
(function (global$1) {
'use strict';
global$1 = 'default' in global$1 ? global$1['default'] : global$1;
global$1 = global$1 && 'default' in global$1 ? global$1['default'] : global$1;
var window = global$1.window;
var self$1 = global$1.self;
@@ -227,10 +227,8 @@
case "Function":
case "Symbol":
return type.toLowerCase();
}
if ((typeof obj === "undefined" ? "undefined" : _typeof(obj)) === "object") {
return "object";
default:
return typeof obj === "undefined" ? "undefined" : _typeof(obj);
}
}
@@ -588,7 +586,13 @@
return arguments.length === 2 || innerEquiv.apply(this, [].slice.call(arguments, 1));
}
return innerEquiv;
return function () {
var result = innerEquiv.apply(undefined, arguments);
// Release any retained objects
pairs.length = 0;
return result;
};
})();
/**
@@ -636,7 +640,13 @@
tests: [],
childModules: [],
testsRun: 0,
unskippedTestsRun: 0
unskippedTestsRun: 0,
hooks: {
before: [],
beforeEach: [],
afterEach: [],
after: []
}
},
callbacks: {},
@@ -1317,7 +1327,7 @@
return TestReport;
}();
var focused = false;
var focused$1 = false;
function Test(settings) {
var i, l;
@@ -1325,12 +1335,30 @@
++Test.count;
this.expected = null;
extend(this, settings);
this.assertions = [];
this.semaphore = 0;
this.module = config.currentModule;
this.stack = sourceFromStacktrace(3);
this.steps = [];
this.timeout = undefined;
// If a module is skipped, all its tests and the tests of the child suites
// should be treated as skipped even if they are defined as `only` or `todo`.
// As for `todo` module, all its tests will be treated as `todo` except for
// tests defined as `skip` which will be left intact.
//
// So, if a test is defined as `todo` and is inside a skipped module, we should
// then treat that test as if was defined as `skip`.
if (this.module.skip) {
settings.skip = true;
settings.todo = false;
// Skipped tests should be left intact
} else if (this.module.todo && !settings.skip) {
settings.todo = true;
}
extend(this, settings);
this.testReport = new TestReport(settings.testName, this.module.suiteReport, {
todo: settings.todo,
@@ -1442,6 +1470,12 @@
function runTest(test) {
promise = test.callback.call(test.testEnvironment, test.assert);
test.resolvePromise(promise);
// If the test has a "lock" on it, but the timeout is 0, then we push a
// failure as the test should be synchronous.
if (test.timeout === 0 && test.semaphore !== 0) {
pushFailure("Test did not finish synchronously even though assert.timeout( 0 ) was used.", sourceFromStacktrace(2));
}
}
},
@@ -1450,22 +1484,27 @@
},
queueHook: function queueHook(hook, hookName, hookOwner) {
var promise,
test = this;
return function runHook() {
var _this = this;
var callHook = function callHook() {
var promise = hook.call(_this.testEnvironment, _this.assert);
_this.resolvePromise(promise, hookName);
};
var runHook = function runHook() {
if (hookName === "before") {
if (hookOwner.unskippedTestsRun !== 0) {
return;
}
test.preserveEnvironment = true;
_this.preserveEnvironment = true;
}
if (hookName === "after" && hookOwner.unskippedTestsRun !== numberOfUnskippedTests(hookOwner) - 1 && config.queue.length > 2) {
return;
}
config.current = test;
config.current = _this;
if (config.notrycatch) {
callHook();
return;
@@ -1473,16 +1512,14 @@
try {
callHook();
} catch (error) {
test.pushFailure(hookName + " failed on " + test.testName + ": " + (error.message || error), extractStacktrace(error, 0));
}
function callHook() {
promise = hook.call(test.testEnvironment, test.assert);
test.resolvePromise(promise, hookName);
_this.pushFailure(hookName + " failed on " + _this.testName + ": " + (error.message || error), extractStacktrace(error, 0));
}
};
return runHook;
},
// Currently only used for module level hooks, can be used to add global level ones
hooks: function hooks(handler) {
var hooks = [];
@@ -1491,8 +1528,11 @@
if (module.parentModule) {
processHooks(test, module.parentModule);
}
if (module.hooks && objectType(module.hooks[handler]) === "function") {
hooks.push(test.queueHook(module.hooks[handler], handler, module));
if (module.hooks[handler].length) {
for (var i = 0; i < module.hooks[handler].length; i++) {
hooks.push(test.queueHook(module.hooks[handler][i], handler, module));
}
}
}
@@ -1500,9 +1540,11 @@
if (!this.skip) {
processHooks(this, this.module);
}
return hooks;
},
finish: function finish() {
config.current = this;
if (config.requireExpects && this.expected === null) {
@@ -1860,7 +1902,7 @@
// Will be exposed as QUnit.test
function test(testName, callback) {
if (focused) {
if (focused$1) {
return;
}
@@ -1873,7 +1915,7 @@
}
function todo(testName, callback) {
if (focused) {
if (focused$1) {
return;
}
@@ -1888,7 +1930,7 @@
// Will be exposed as QUnit.skip
function skip(testName) {
if (focused) {
if (focused$1) {
return;
}
@@ -1902,12 +1944,12 @@
// Will be exposed as QUnit.only
function only(testName, callback) {
if (focused) {
if (focused$1) {
return;
}
config.queue.length = 0;
focused = true;
focused$1 = true;
var newTest = new Test({
testName: testName,
@@ -1919,20 +1961,29 @@
// Put a hold on processing and return a function that will release it.
function internalStop(test) {
var released = false;
test.semaphore += 1;
config.blocking = true;
// Set a recovery timeout, if so configured.
if (config.testTimeout && defined.setTimeout) {
clearTimeout(config.timeout);
config.timeout = setTimeout(function () {
pushFailure("Test timed out", sourceFromStacktrace(2));
internalRecover(test);
}, config.testTimeout);
if (defined.setTimeout) {
var timeoutDuration = void 0;
if (typeof test.timeout === "number") {
timeoutDuration = test.timeout;
} else if (typeof config.testTimeout === "number") {
timeoutDuration = config.testTimeout;
}
if (typeof timeoutDuration === "number" && timeoutDuration > 0) {
clearTimeout(config.timeout);
config.timeout = setTimeout(function () {
pushFailure("Test took longer than " + timeoutDuration + "ms; test timed out.", sourceFromStacktrace(2));
internalRecover(test);
}, timeoutDuration);
}
}
var released = false;
return function resume() {
if (released) {
return;
@@ -2059,10 +2110,19 @@
// Assert helpers
// Documents a "step", which is a string value, in a test as a passing assertion
createClass(Assert, [{
key: "timeout",
value: function timeout(duration) {
if (typeof duration !== "number") {
throw new Error("You must pass a number as the duration to assert.timeout");
}
this.test.timeout = duration;
}
// Documents a "step", which is a string value, in a test as a passing assertion
}, {
key: "step",
value: function step(message) {
var result = !!message;
@@ -2138,7 +2198,7 @@
}, {
key: "push",
value: function push(result, actual, expected, message, negative) {
Logger.warn("assert.push is deprecated and will be removed in QUnit 3.0." + " Please use assert.pushResult instead (http://api.qunitjs.com/pushResult/).");
Logger.warn("assert.push is deprecated and will be removed in QUnit 3.0." + " Please use assert.pushResult instead (https://api.qunitjs.com/assert/pushResult).");
var currentAssert = this instanceof Assert ? this : config.current.assert;
return currentAssert.pushResult({
@@ -2573,6 +2633,7 @@
return false;
}
var focused = false;
var QUnit = {};
var globalSuite = new SuiteReport();
@@ -2589,13 +2650,16 @@
QUnit.isLocal = !(defined.document && window.location.protocol !== "file:");
// Expose the current QUnit version
QUnit.version = "2.3.3";
QUnit.version = "2.4.0";
function createModule(name, testEnvironment) {
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,
@@ -2604,7 +2668,14 @@
testsRun: 0,
unskippedTestsRun: 0,
childModules: [],
suiteReport: new SuiteReport(name, parentSuite)
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 = {};
@@ -2619,53 +2690,108 @@
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 });
};
extend(QUnit, {
on: on,
// Call on start of module test to prepend name to all tests
module: function module(name, testEnvironment, executeNow) {
if (arguments.length === 2) {
if (objectType(testEnvironment) === "function") {
executeNow = testEnvironment;
testEnvironment = undefined;
}
}
var module = createModule(name, testEnvironment);
// Move any hooks to a 'hooks' object
if (module.testEnvironment) {
module.hooks = {
before: module.testEnvironment.before,
beforeEach: module.testEnvironment.beforeEach,
afterEach: module.testEnvironment.afterEach,
after: module.testEnvironment.after
};
delete module.testEnvironment.before;
delete module.testEnvironment.beforeEach;
delete module.testEnvironment.afterEach;
delete module.testEnvironment.after;
}
var moduleFns = {
before: setHook(module, "before"),
beforeEach: setHook(module, "beforeEach"),
afterEach: setHook(module, "afterEach"),
after: setHook(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;
},
module: module$1,
test: test,
@@ -2802,13 +2928,9 @@
ProcessingQueue.advance();
}
function setHook(module, hookName) {
if (!module.hooks) {
module.hooks = {};
}
return function (callback) {
module.hooks[hookName] = callback;
function setHookFunction(module, hookName) {
return function setHook(callback) {
module.hooks[hookName].push(callback);
};
}