updated qunit test reporting so sauce labs can report failing tests
This commit is contained in:
parent
4b622c60c1
commit
7a80b801d7
|
@ -11,8 +11,32 @@
|
||||||
<script src="vendor/qunit.js"></script>
|
<script src="vendor/qunit.js"></script>
|
||||||
<script>
|
<script>
|
||||||
// See https://github.com/axemclion/grunt-saucelabs#test-result-details-with-qunit
|
// See https://github.com/axemclion/grunt-saucelabs#test-result-details-with-qunit
|
||||||
QUnit.done(function (results) {
|
var log = []
|
||||||
window.global_test_results = results
|
QUnit.done = function (test_results) {
|
||||||
|
var tests = log.map(function (details) {
|
||||||
|
return {
|
||||||
|
name: details.name,
|
||||||
|
result: details.result,
|
||||||
|
expected: details.expected,
|
||||||
|
actual: details.actual,
|
||||||
|
source: details.source
|
||||||
|
}
|
||||||
|
})
|
||||||
|
test_results.tests = tests
|
||||||
|
|
||||||
|
// Delaying results a bit because in real-world scenario you won't get them immediately
|
||||||
|
setTimeout(function () {
|
||||||
|
window.global_test_results = test_results
|
||||||
|
}, 2000)
|
||||||
|
}
|
||||||
|
|
||||||
|
QUnit.testStart(function (testDetails) {
|
||||||
|
QUnit.log = function (details) {
|
||||||
|
if (!details.result) {
|
||||||
|
details.name = testDetails.name
|
||||||
|
log.push(details)
|
||||||
|
}
|
||||||
|
}
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue