This commit is contained in:
Geoffrey Goh
2015-12-23 21:24:29 -08:00
parent aac19e25d6
commit ebd93b53eb
29 changed files with 309 additions and 425 deletions

View File

@@ -18,18 +18,17 @@ function createTestCaseComponent(displayName, description, setUp, runTest, passA
done: false,
};
},
componentDidMount() {
setUp()
.then(runTest)
.then(() => {
if (passAfterRun) {
this.setState({done: true}, RCTTestModule.markTestCompleted);
}
})
.catch((err) => {
console.error(err);
throw err;
});
async componentDidMount() {
try {
await setUp();
await runTest();
if (passAfterRun) {
this.setState({done: true}, RCTTestModule.markTestCompleted);
}
} catch (err) {
console.error(err);
throw err;
}
},
render() {
return (