mirror of https://github.com/embarklabs/embark.git
use setInterval to wait for deploy complete
This commit is contained in:
parent
40c363a310
commit
d14630f636
|
@ -17,22 +17,28 @@ config({
|
||||||
"args": ["$ENSRegistry", rootNode],
|
"args": ["$ENSRegistry", rootNode],
|
||||||
"onDeploy": [
|
"onDeploy": [
|
||||||
`ENSRegistry.methods.setOwner('${rootNode}', web3.eth.defaultAccount).send().then(() => {
|
`ENSRegistry.methods.setOwner('${rootNode}', web3.eth.defaultAccount).send().then(() => {
|
||||||
ENSRegistry.methods.setResolver('${rootNode}', "$Resolver").send();
|
ENSRegistry.methods.setResolver('${rootNode}', "$Resolver").send();
|
||||||
Resolver.methods.setAddr('${rootNode}', '${address}').send();
|
Resolver.methods.setAddr('${rootNode}', '${address}').send().then(() => {
|
||||||
})`
|
global.ensTestReady = true;
|
||||||
|
});
|
||||||
|
});`
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
contract("ENS", function () {
|
contract("ENS", function () {
|
||||||
this.timeout(0);
|
this.timeout(1000);
|
||||||
|
|
||||||
before(function (done) {
|
before(function (done) {
|
||||||
// Wait for onDeploy to finish
|
// Wait for onDeploy to finish
|
||||||
setTimeout(function () {
|
const wait = setInterval(() => {
|
||||||
|
if (!global.ensTestReady) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
clearInterval(wait);
|
||||||
done();
|
done();
|
||||||
}, 500);
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should have registered embark.eth", async function () {
|
it("should have registered embark.eth", async function () {
|
||||||
|
|
Loading…
Reference in New Issue