Fix for test runner not finishing when test fails or there is error

This commit is contained in:
Shailesh Kumar 2015-06-08 16:27:54 +02:00
parent 6c5883046f
commit 1a57ef062b
1 changed files with 10 additions and 7 deletions

View File

@ -51,13 +51,13 @@ function testWriteAndReadFile() {
.then((contents) => {
updateMessage('FILE READ! Contents:');
readText = contents;
updateMessage(readText);
expectEqual(text, readText, 'testWriteAndReadFile');
updateMessage('readFile correctly returned' + readText);
})
.finally(() => {
runTestCase('testCreateAndDeleteFile', testCreateAndDeleteFile);
})
.catch((err) => {
updateMessage(err.message, err.code);
});
.done();//promise done needed to throw exception so that in case test fails,error is propagated
}
@ -84,9 +84,12 @@ function testCreateAndDeleteFile() {
})
.catch((err) => {
updateMessage('catch' + err);
expectTrue(true,'File is deleted');
done();
});
expectTrue(true,'File is deleted');
})
.finally(() => {
done(); //testrunners done
})
.done(); //promise done needed to throw exception so that in case test fails,error is propagated
}