mirror of
https://github.com/zhigang1992/react-native-code-push.git
synced 2026-06-11 08:04:23 +08:00
es7
This commit is contained in:
@@ -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 (
|
||||
|
||||
Reference in New Issue
Block a user