Apply code formatting to API unit tests

This commit is contained in:
Elliot Lee
2018-02-21 16:05:57 -08:00
parent 365de6d18a
commit 3cad4f4aa3

View File

@@ -885,7 +885,8 @@ describe('RippleAPI', function() {
});
it('getTransactions - earliest first', function () {
const options = {types: ['payment', 'order'], initiated: true, limit: 2,
const options = {
types: ['payment', 'order'], initiated: true, limit: 2,
earliestFirst: true
};
const expected = _.cloneDeep(responses.getTransactions.normal)
@@ -896,7 +897,8 @@ describe('RippleAPI', function() {
it('getTransactions - earliest first with start option', function () {
const options = {types: ['payment', 'order'], initiated: true, limit: 2,
const options = {
types: ['payment', 'order'], initiated: true, limit: 2,
start: hashes.VALID_TRANSACTION_HASH,
earliestFirst: true
};
@@ -906,7 +908,8 @@ describe('RippleAPI', function() {
});
it('getTransactions - gap', function () {
const options = {types: ['payment', 'order'], initiated: true, limit: 2,
const options = {
types: ['payment', 'order'], initiated: true, limit: 2,
maxLedgerVersion: 348858000
};
return this.api.getTransactions(address, options).then(() => {
@@ -917,7 +920,8 @@ describe('RippleAPI', function() {
});
it('getTransactions - tx not found', function () {
const options = {types: ['payment', 'order'], initiated: true, limit: 2,
const options = {
types: ['payment', 'order'], initiated: true, limit: 2,
start: hashes.NOTFOUND_TRANSACTION_HASH,
counterparty: address
};
@@ -929,7 +933,8 @@ describe('RippleAPI', function() {
});
it('getTransactions - filters', function () {
const options = {types: ['payment', 'order'], initiated: true, limit: 10,
const options = {
types: ['payment', 'order'], initiated: true, limit: 10,
excludeFailures: true,
counterparty: addresses.ISSUER
};
@@ -941,7 +946,8 @@ describe('RippleAPI', function() {
});
it('getTransactions - filters for incoming', function () {
const options = {types: ['payment', 'order'], initiated: false, limit: 10,
const options = {
types: ['payment', 'order'], initiated: false, limit: 10,
excludeFailures: true,
counterparty: addresses.ISSUER
};
@@ -1441,7 +1447,8 @@ describe('RippleAPI', function() {
.then(response => {
const ledger = _.assign({}, response, {
parentCloseTime: response.closeTime, stateHash:
'D9ABF622DA26EEEE48203085D4BC23B0F77DC6F8724AC33D975DA3CA492D2E44'});
'D9ABF622DA26EEEE48203085D4BC23B0F77DC6F8724AC33D975DA3CA492D2E44'
});
assert.throws(() => {
const hash = this.api.computeLedgerHash(ledger);
unused(hash);
@@ -1639,8 +1646,10 @@ describe('RippleAPI - offline', function() {
it('computeLedgerHash - incorrent transaction_hash', function () {
const api = new RippleAPI();
const header = _.assign({}, requests.computeLedgerHash.header,
{transactionHash:
'325EACC5271322539EEEC2D6A5292471EF1B3E72AE7180533EFC3B8F0AD435C9'});
{
transactionHash:
'325EACC5271322539EEEC2D6A5292471EF1B3E72AE7180533EFC3B8F0AD435C9'
});
header.rawTransactions = JSON.stringify(
requests.computeLedgerHash.transactions);
assert.throws(() => api.computeLedgerHash(header));