updated tests to be compatible with the limited api version available in the browser_client, and updated grunt-saucelabs

This commit is contained in:
Spencer Alger
2014-07-29 23:04:54 -07:00
parent 017a554683
commit 0e05b0f0a1
4 changed files with 128 additions and 64 deletions

View File

@ -17,9 +17,34 @@
</script>
<script src="unit_tests.js"></script>
<script>
mochaRunner = mocha.run().on('end', function(){
window.mochaResults = this.stats;
});
(function (root) {
var failedTests = [];
var flattenTitles = function (test) {
var titles = [];
while (test && test.parent && test.parent.title) {
titles.unshift(test.parent.title);
test = test.parent
}
return titles;
};
var runner = root.mochaRunner = mocha.run()
.on('end', function(){
window.mochaResults = runner.stats;
window.mochaResults.reports = failedTests;
})
.on('fail', function logFailure(test, err){
failedTests.push({
name: test.title,
result: false,
message: err.message,
stack: err.stack,
titles: flattenTitles(test)
});
});
}(window));
</script>
</body>
</html>