mirror of https://github.com/embarklabs/embark.git
fix(test/blockchain): fix race condition of installing web3 and test
This commit is contained in:
parent
976f9944a8
commit
8ebba404e2
|
@ -34,15 +34,17 @@ class Test {
|
|||
init(callback) {
|
||||
this.gasLimit = constants.tests.gasLimit;
|
||||
this.events.request('deploy:setGasLimit', this.gasLimit);
|
||||
if (this.options.node !== 'embark') {
|
||||
this.showNodeHttpWarning();
|
||||
return callback();
|
||||
}
|
||||
if (!this.ipc.connected) {
|
||||
this.logger.error("Could not connect to Embark's IPC. Is embark running?");
|
||||
if (!this.options.inProcess) process.exit(1);
|
||||
}
|
||||
return this.connectToIpcNode(callback);
|
||||
this.events.request('blockchain:connector:ready', () => {
|
||||
if (this.options.node !== 'embark') {
|
||||
this.showNodeHttpWarning();
|
||||
return callback();
|
||||
}
|
||||
if (!this.ipc.connected) {
|
||||
this.logger.error("Could not connect to Embark's IPC. Is embark running?");
|
||||
if (!this.options.inProcess) process.exit(1);
|
||||
}
|
||||
this.connectToIpcNode(callback);
|
||||
});
|
||||
}
|
||||
|
||||
connectToIpcNode(cb) {
|
||||
|
|
|
@ -44,5 +44,11 @@ module.exports = (embark) => {
|
|||
|
||||
embark.addConsoleProviderInit('blockchain', code, shouldInit);
|
||||
});
|
||||
|
||||
embark.events.setCommandHandler('blockchain:connector:ready', (cb) => {
|
||||
pathPromise.then((_web3Location) => {
|
||||
cb();
|
||||
});
|
||||
});
|
||||
});
|
||||
};
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
{
|
||||
"default": {
|
||||
"versions": {
|
||||
"web3": "1.0.0-beta.27",
|
||||
"solc": "0.4.24"
|
||||
},
|
||||
"deployment": {
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
{
|
||||
"contracts": ["contracts/**"],
|
||||
"contracts": [
|
||||
"contracts/**"
|
||||
],
|
||||
"app": {},
|
||||
"buildDir": "build/",
|
||||
"config": {
|
||||
|
@ -12,5 +14,8 @@
|
|||
"versions": {
|
||||
"web3": "1.0.0-beta",
|
||||
"solc": "0.4.24"
|
||||
},
|
||||
"plugins": {
|
||||
"web3Connector": {}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
{
|
||||
"devDependencies": {
|
||||
"embark": "4.0.0-beta.0",
|
||||
"rimraf": "2.6.3"
|
||||
"rimraf": "2.6.3",
|
||||
"web3Connector": "file:../../../packages/web3Connector"
|
||||
},
|
||||
"name": "contracts_app",
|
||||
"private": true,
|
||||
|
|
Loading…
Reference in New Issue