Show tests on html view

This commit is contained in:
Nathan Leniz
2015-02-14 18:31:32 -05:00
parent 693b8fbb33
commit 9ac19023d9
4 changed files with 29 additions and 23 deletions

View File

@@ -1,21 +1,18 @@
(function() {
var allTestsGood = true;
var expect = chai.expect;
var tests = parent.tests;
for (var i = 0; i < tests.length; i++) {
var thisTest = true;
try {
eval(tests[i]);
eval(parent.tests[i]);
} catch (err) {
allTestsGood = false;
console.log('All tests are good?', allTestsGood);
parent.postError(err);
thisTest = false;
parent.postError(JSON.stringify(tests[i]));
} finally {
if (allTestsGood) {
console.log('You should not be able to see me if there are errors on teh screen!', allTestsGood);
parent.postSuccess();
if (thisTest) {
parent.postSuccess(JSON.stringify(tests[i]));
}
}
}