diff --git a/.jest b/.jest index 35ec7d7a44..9c8e79be57 100644 --- a/.jest +++ b/.jest @@ -1,3 +1,3 @@ -jasmine.DEFAULT_TIMEOUT_INTERVAL = 50000 +jasmine.DEFAULT_TIMEOUT_INTERVAL = 120000 process.on('unhandledRejection', e => console.log(e)) diff --git a/package.json b/package.json index aa9f7a5dc1..42cdfb3bcb 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ }, "scripts": { "start": "gulp watch", - "test": "eslint src/ && jest -w 10 --coverage && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage", + "test": "eslint src/ && jest -w 1 --coverage && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage", "release": "d() { test -z $1 && echo 'Please specify branch.' && exit 1; (git show-branch $1) || exit 1; git stash; git checkout $1; npm i; rm -rf branch/$1; mkdir -p branch/$1 ; gulp build-min; cp -r www/ branch/$1; gulp release-branch --branch $1;}; d", "release-production": "d() { git stash; git checkout master; npm i;gulp build-min;gulp release-master;}; d", "build": "webpack --config webpack.config.cli.js" diff --git a/src/botPage/bot/TradeEngine/index.js b/src/botPage/bot/TradeEngine/index.js index 8ad3f62180..f93ffbd8ce 100644 --- a/src/botPage/bot/TradeEngine/index.js +++ b/src/botPage/bot/TradeEngine/index.js @@ -115,10 +115,16 @@ export default class TradeEngine extends Balance(Purchase(Sell(OpenContract(Prop this.listen('authorize', ({ authorize }) => { this.accountInfo = authorize; this.token = token; - this.api.subscribeToBalance().then(r => { - this.balance = Number(r.balance.balance); + + // Only subscribe to balance in browser, not for tests. + if (document) { + this.api.subscribeToBalance().then(r => { + this.balance = Number(r.balance.balance); + resolve(); + }); + } else { resolve(); - }); + } }) ); }