refactor: improves mock rippled structure (#1569)

* better error handling + tests

* fix tests

* change addResponse to take a string instead of a Request

* remove unneeded change

* respond to comments

* fix tests, re-lint

* improve error message
This commit is contained in:
Mayukha Vadari
2021-08-27 10:17:39 -04:00
parent 759e075e54
commit b8be6c2f1b
30 changed files with 763 additions and 2110 deletions

View File

@@ -9,10 +9,7 @@ import { TestSuite, assertResultMatch } from "../testUtils";
*/
export default <TestSuite>{
"request account_objects": async (client, address, mockRippled) => {
mockRippled.addResponse(
{ command: "account_objects", account: address },
rippled.account_objects.normal
);
mockRippled.addResponse("account_objects", rippled.account_objects.normal);
const result = await client.request({
command: "account_objects",
account: address,
@@ -30,10 +27,7 @@ export default <TestSuite>{
address,
mockRippled
) => {
mockRippled.addResponse(
{ command: "account_objects", account: address },
rippled.account_objects.normal
);
mockRippled.addResponse("account_objects", rippled.account_objects.normal);
const result = await client.request({
command: "account_objects",
account: address,