Better error message when using methods that require a connection when servers are not provided

This commit is contained in:
Chris Clark
2015-11-02 14:50:38 -08:00
parent 90c928205a
commit 8074baa3b5
5 changed files with 22 additions and 5 deletions

View File

@@ -884,6 +884,15 @@ describe('RippleAPI - offline', function() {
});
});
it('getServerInfo - offline', function() {
const api = new RippleAPI();
return api.getServerInfo().then(() => {
assert(false, 'Should throw error');
}).catch(error => {
assert(error instanceof api.errors.NotConnectedError);
});
});
it('computeLedgerHash', function() {
const api = new RippleAPI();
const header = requests.computeLedgerHash.header;