Skip to content
This repository was archived by the owner on Feb 22, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .jest
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
jasmine.DEFAULT_TIMEOUT_INTERVAL = 50000
jasmine.DEFAULT_TIMEOUT_INTERVAL = 120000

process.on('unhandledRejection', e => console.log(e))
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
12 changes: 9 additions & 3 deletions src/botPage/bot/TradeEngine/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
}
})
);
}
Expand Down