Skip to content

Commit 1a57ef0

Browse files
committed
Fix for test runner not finishing when test fails or there is error
1 parent 6c58830 commit 1a57ef0

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

IntegrationTests/FSTest.js

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,13 @@ function testWriteAndReadFile() {
5151
.then((contents) => {
5252
updateMessage('FILE READ! Contents:');
5353
readText = contents;
54-
updateMessage(readText);
5554
expectEqual(text, readText, 'testWriteAndReadFile');
55+
updateMessage('readFile correctly returned' + readText);
56+
})
57+
.finally(() => {
5658
runTestCase('testCreateAndDeleteFile', testCreateAndDeleteFile);
5759
})
58-
.catch((err) => {
59-
updateMessage(err.message, err.code);
60-
});
60+
.done();//promise done needed to throw exception so that in case test fails,error is propagated
6161
}
6262

6363

@@ -84,9 +84,12 @@ function testCreateAndDeleteFile() {
8484
})
8585
.catch((err) => {
8686
updateMessage('catch' + err);
87-
expectTrue(true,'File is deleted');
88-
done();
89-
});
87+
expectTrue(true,'File is deleted');
88+
})
89+
.finally(() => {
90+
done(); //testrunners done
91+
})
92+
.done(); //promise done needed to throw exception so that in case test fails,error is propagated
9093
}
9194

9295

0 commit comments

Comments
 (0)