mirror of
https://github.com/twbs/bootstrap.git
synced 2025-01-29 21:52:22 +01:00
restore that
This commit is contained in:
parent
0a7a1b7a99
commit
6b825f98e7
@ -2,72 +2,71 @@
|
|||||||
* grunt-contrib-qunit
|
* grunt-contrib-qunit
|
||||||
* http://gruntjs.com/
|
* http://gruntjs.com/
|
||||||
*
|
*
|
||||||
* Copyright (c) 2016 "Cowboy" Ben Alman, contributors
|
* Copyright (c) 2014 "Cowboy" Ben Alman, contributors
|
||||||
* Licensed under the MIT license.
|
* Licensed under the MIT license.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* global QUnit:true, alert:true */
|
(function () {
|
||||||
|
|
||||||
(function (factory) {
|
|
||||||
if (typeof define === 'function' && define.amd) {
|
|
||||||
require(['qunit'], factory);
|
|
||||||
} else {
|
|
||||||
factory(QUnit);
|
|
||||||
}
|
|
||||||
}(function(QUnit) {
|
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
// Don't re-order tests.
|
// Don't re-order tests.
|
||||||
QUnit.config.reorder = false;
|
QUnit.config.reorder = false
|
||||||
|
// Run tests serially, not in parallel.
|
||||||
|
QUnit.config.autorun = false
|
||||||
|
|
||||||
// Send messages to the parent PhantomJS process via alert! Good times!!
|
// Send messages to the parent PhantomJS process via alert! Good times!!
|
||||||
function sendMessage() {
|
function sendMessage() {
|
||||||
var args = [].slice.call(arguments);
|
var args = [].slice.call(arguments)
|
||||||
alert(JSON.stringify(args));
|
alert(JSON.stringify(args))
|
||||||
}
|
}
|
||||||
|
|
||||||
// These methods connect QUnit to PhantomJS.
|
// These methods connect QUnit to PhantomJS.
|
||||||
QUnit.log(function(obj) {
|
QUnit.log(function (obj) {
|
||||||
// What is this I don’t even
|
// What is this I don’t even
|
||||||
if (obj.message === '[object Object], undefined:undefined') {
|
if (obj.message === '[object Object], undefined:undefined') { return }
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Parse some stuff before sending it.
|
// Parse some stuff before sending it.
|
||||||
var actual;
|
var actual
|
||||||
var expected;
|
var expected
|
||||||
|
|
||||||
if (!obj.result) {
|
if (!obj.result) {
|
||||||
// Dumping large objects can be very slow, and the dump isn't used for
|
// Dumping large objects can be very slow, and the dump isn't used for
|
||||||
// passing tests, so only dump if the test failed.
|
// passing tests, so only dump if the test failed.
|
||||||
actual = QUnit.dump.parse(obj.actual);
|
actual = QUnit.dump.parse(obj.actual)
|
||||||
expected = QUnit.dump.parse(obj.expected);
|
expected = QUnit.dump.parse(obj.expected)
|
||||||
}
|
}
|
||||||
// Send it.
|
// Send it.
|
||||||
sendMessage('qunit.log', obj.result, actual, expected, obj.message, obj.source, obj.todo);
|
sendMessage('qunit.log', obj.result, actual, expected, obj.message, obj.source)
|
||||||
});
|
})
|
||||||
|
|
||||||
QUnit.testStart(function(obj) {
|
QUnit.testStart(function (obj) {
|
||||||
sendMessage('qunit.testStart', obj.name);
|
sendMessage('qunit.testStart', obj.name)
|
||||||
});
|
})
|
||||||
|
|
||||||
QUnit.testDone(function(obj) {
|
QUnit.testDone(function (obj) {
|
||||||
sendMessage('qunit.testDone', obj.name, obj.failed, obj.passed, obj.total, obj.runtime, obj.skipped, obj.todo);
|
sendMessage('qunit.testDone', obj.name, obj.failed, obj.passed, obj.total, obj.duration)
|
||||||
});
|
})
|
||||||
|
|
||||||
QUnit.moduleStart(function(obj) {
|
QUnit.moduleStart(function (obj) {
|
||||||
sendMessage('qunit.moduleStart', obj.name);
|
sendMessage('qunit.moduleStart', obj.name)
|
||||||
});
|
})
|
||||||
|
|
||||||
QUnit.moduleDone(function(obj) {
|
QUnit.moduleDone(function (obj) {
|
||||||
sendMessage('qunit.moduleDone', obj.name, obj.failed, obj.passed, obj.total);
|
if (obj.failed === 0) {
|
||||||
});
|
console.log('\r\u221A All tests passed in "' + obj.name + '" module')
|
||||||
|
} else {
|
||||||
|
console.log('\u00D7 ' + obj.failed + ' tests failed in "' + obj.name + '" module')
|
||||||
|
}
|
||||||
|
sendMessage('qunit.moduleDone', obj.name, obj.failed, obj.passed, obj.total)
|
||||||
|
})
|
||||||
|
|
||||||
QUnit.begin(function() {
|
QUnit.begin(function () {
|
||||||
sendMessage('qunit.begin');
|
sendMessage('qunit.begin')
|
||||||
});
|
console.log('\n\nStarting test suite')
|
||||||
|
console.log('================================================\n')
|
||||||
|
})
|
||||||
|
|
||||||
QUnit.done(function(obj) {
|
QUnit.done(function (obj) {
|
||||||
sendMessage('qunit.done', obj.failed, obj.passed, obj.total, obj.runtime);
|
sendMessage('qunit.done', obj.failed, obj.passed, obj.total, obj.runtime)
|
||||||
});
|
})
|
||||||
}));
|
|
||||||
|
}())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user