mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-21 07:16:17 -04:00
Tweaks and restructuring of test runner.
This commit is contained in:
parent
6e5ea5d75f
commit
d7e396c04f
12 changed files with 99 additions and 149 deletions
|
@ -3,36 +3,36 @@
|
|||
*
|
||||
* This is for actually running the tests in the test register.
|
||||
*
|
||||
* @author tlwr [toby@toby.codes
|
||||
*
|
||||
* @author tlwr [toby@toby.codes]
|
||||
* @copyright Crown Copyright 2017
|
||||
* @license Apache-2.0
|
||||
*
|
||||
*/
|
||||
(function() {
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
TestRegister.runTests()
|
||||
.then(function(results) {
|
||||
results.forEach(function(testResult) {
|
||||
if (typeof window.callPhantom === "function") {
|
||||
window.callPhantom(
|
||||
"testResult",
|
||||
testResult
|
||||
);
|
||||
} else {
|
||||
var output = [
|
||||
"----------",
|
||||
testResult.test.name,
|
||||
testResult.status,
|
||||
testResult.output,
|
||||
].join("<br>");
|
||||
document.body.innerHTML += "<div>" + output + "</div>";
|
||||
}
|
||||
});
|
||||
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
TestRegister.runTests()
|
||||
.then(function(results) {
|
||||
results.forEach(function(testResult) {
|
||||
|
||||
if (typeof window.callPhantom === "function") {
|
||||
window.callPhantom("exit");
|
||||
// If we're running this in PhantomJS
|
||||
window.callPhantom(
|
||||
"testResult",
|
||||
testResult
|
||||
);
|
||||
} else {
|
||||
// If we're just viewing this in a normal browser
|
||||
var output = [
|
||||
"----------",
|
||||
testResult.test.name,
|
||||
testResult.status,
|
||||
testResult.output,
|
||||
].join("<br>");
|
||||
document.querySelector("main").innerHTML += output;
|
||||
}
|
||||
});
|
||||
|
||||
if (typeof window.callPhantom === "function") {
|
||||
window.callPhantom("exit");
|
||||
}
|
||||
});
|
||||
})();
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue