adds saucelabs integration to unit tests
This commit is contained in:
parent
c8e0d917f7
commit
4d41c087b0
6 changed files with 149 additions and 7 deletions
|
|
@ -1,3 +1,31 @@
|
|||
//saucelabs reporting; see https://github.com/axemclion/grunt-saucelabs#test-result-details-with-qunit
|
||||
var log = [];
|
||||
var testName;
|
||||
QUnit.done(function (test_results) {
|
||||
var tests = [];
|
||||
for(var i = 0, len = log.length; i < len; i++) {
|
||||
var details = log[i];
|
||||
tests.push({
|
||||
name: details.name,
|
||||
result: details.result,
|
||||
expected: details.expected,
|
||||
actual: details.actual,
|
||||
source: details.source
|
||||
});
|
||||
}
|
||||
test_results.tests = tests;
|
||||
|
||||
window.global_test_results = test_results;
|
||||
});
|
||||
QUnit.testStart(function(testDetails){
|
||||
QUnit.log(function(details){
|
||||
if (!details.result) {
|
||||
details.name = testDetails.name;
|
||||
log.push(details);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
//qunit doesn't support Function.prototype.bind...
|
||||
if (!Function.prototype.bind) {
|
||||
Function.prototype.bind = function (oThis) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue