-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c83ac3b
commit 058e05b
Showing
2 changed files
with
2,686 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<link href="https://unpkg.com/mocha@3.5.3/mocha.css" rel="stylesheet"> | ||
</head> | ||
<body> | ||
<div id="mocha"></div> | ||
<script src="https://unpkg.com/mocha@3.5.3/mocha.js"></script> | ||
<script> | ||
function appendTest() { | ||
var script = document.createElement("script"); | ||
script.type = "text/javascript"; | ||
script.src = "test-browser.js?" + Date.now(); | ||
document.body.appendChild(script); | ||
} | ||
|
||
mocha.setup('bdd'); | ||
|
||
window.TESTS_COMPLETE = false; | ||
window.TESTS_PASSED = 0; | ||
window.TESTS_FAILED = 0; | ||
appendTest(); | ||
|
||
window.onload = function () { | ||
var runner = mocha.run(); | ||
|
||
runner.on('test end', function (test) { | ||
if (test.state === 'passed') window.TESTS_PASSED++; | ||
else window.TESTS_FAILED++; | ||
}); | ||
|
||
runner.on('end', function () { | ||
window.TESTS_COMPLETE = true; | ||
}); | ||
}; | ||
</script> | ||
</body> | ||
</html> |
Oops, something went wrong.