Forked from phillipskevin/reload-tests-on-success.html
Created
March 8, 2017 02:01
-
-
Save marshallswain/7d20ae6eafae3e6a07bcbc2b29dba27d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="../node_modules/steal/steal.js"> | |
window.rerun = true; | |
function rerunIfSuccessful() { | |
var result = document.getElementById('qunit-testresult'); | |
var failed = result.getElementsByClassName('failed'); | |
if (!failed.length) { | |
setTimeout(rerunIfSuccessful, 4000); | |
} else if (failed[0].innerHTML === "0" && window.rerun) { | |
location.reload(true); | |
} | |
} | |
setTimeout(rerunIfSuccessful, 4000); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment