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) {
|
init(callback) {
|
||||||
this.gasLimit = constants.tests.gasLimit;
|
this.gasLimit = constants.tests.gasLimit;
|
||||||
this.events.request('deploy:setGasLimit', this.gasLimit);
|
this.events.request('deploy:setGasLimit', this.gasLimit);
|
||||||
if (this.options.node !== 'embark') {
|
this.events.request('blockchain:connector:ready', () => {
|
||||||
this.showNodeHttpWarning();
|
if (this.options.node !== 'embark') {
|
||||||
return callback();
|
this.showNodeHttpWarning();
|
||||||
}
|
return callback();
|
||||||
if (!this.ipc.connected) {
|
}
|
||||||
this.logger.error("Could not connect to Embark's IPC. Is embark running?");
|
if (!this.ipc.connected) {
|
||||||
if (!this.options.inProcess) process.exit(1);
|
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.connectToIpcNode(callback);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
connectToIpcNode(cb) {
|
connectToIpcNode(cb) {
|
||||||
|
|
|
@ -44,5 +44,11 @@ module.exports = (embark) => {
|
||||||
|
|
||||||
embark.addConsoleProviderInit('blockchain', code, shouldInit);
|
embark.addConsoleProviderInit('blockchain', code, shouldInit);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
embark.events.setCommandHandler('blockchain:connector:ready', (cb) => {
|
||||||
|
pathPromise.then((_web3Location) => {
|
||||||
|
cb();
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
{
|
{
|
||||||
"default": {
|
"default": {
|
||||||
"versions": {
|
"versions": {
|
||||||
"web3": "1.0.0-beta.27",
|
|
||||||
"solc": "0.4.24"
|
"solc": "0.4.24"
|
||||||
},
|
},
|
||||||
"deployment": {
|
"deployment": {
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
{
|
{
|
||||||
"contracts": ["contracts/**"],
|
"contracts": [
|
||||||
|
"contracts/**"
|
||||||
|
],
|
||||||
"app": {},
|
"app": {},
|
||||||
"buildDir": "build/",
|
"buildDir": "build/",
|
||||||
"config": {
|
"config": {
|
||||||
|
@ -12,5 +14,8 @@
|
||||||
"versions": {
|
"versions": {
|
||||||
"web3": "1.0.0-beta",
|
"web3": "1.0.0-beta",
|
||||||
"solc": "0.4.24"
|
"solc": "0.4.24"
|
||||||
|
},
|
||||||
|
"plugins": {
|
||||||
|
"web3Connector": {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
{
|
{
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"embark": "4.0.0-beta.0",
|
"embark": "4.0.0-beta.0",
|
||||||
"rimraf": "2.6.3"
|
"rimraf": "2.6.3",
|
||||||
|
"web3Connector": "file:../../../packages/web3Connector"
|
||||||
},
|
},
|
||||||
"name": "contracts_app",
|
"name": "contracts_app",
|
||||||
"private": true,
|
"private": true,
|
||||||
|
|
Loading…
Reference in New Issue