test: removes the use of TestSuite (#1566)* switch all methods to new format* clean up rippleClient* rename files to remove ripple from name* additional cleanup

This commit is contained in:
Mayukha Vadari
2021-08-30 18:04:06 -04:00
parent 43802f9e22
commit 6268b9ea26
41 changed files with 3880 additions and 3699 deletions

View File

@@ -1,42 +1,47 @@
import responses from "../fixtures/responses";
import rippled from "../fixtures/rippled";
import { TestSuite, assertResultMatch } from "../testUtils";
import setupClient from "../setupClient";
import { addressTests, assertResultMatch } from "../testUtils";
/**
* Every test suite exports their tests in the default object.
* - Check out the "TestSuite" type for documentation on the interface.
* - Check out "test/client/index.ts" for more information about the test runner.
*/
export default <TestSuite>{
"request account_objects": async (client, address, mockRippled) => {
mockRippled.addResponse("account_objects", rippled.account_objects.normal);
const result = await client.request({
command: "account_objects",
account: address,
describe("client.request", function () {
beforeEach(setupClient.setup);
afterEach(setupClient.teardown);
addressTests.forEach(function (test) {
describe(test.type, function () {
it("request account_objects", async function () {
this.mockRippled.addResponse(
"account_objects",
rippled.account_objects.normal
);
const result = await this.client.request({
command: "account_objects",
account: test.address,
});
assertResultMatch(
result.result,
responses.getAccountObjects,
"AccountObjectsResponse"
);
});
it("request account_objects - invalid options", async function () {
this.mockRippled.addResponse(
"account_objects",
rippled.account_objects.normal
);
const result = await this.client.request({
command: "account_objects",
account: test.address,
});
assertResultMatch(
result.result,
responses.getAccountObjects,
"AccountObjectsResponse"
);
});
});
assertResultMatch(
result.result,
responses.getAccountObjects,
"AccountObjectsResponse"
);
},
"request account_objects - invalid options": async (
client,
address,
mockRippled
) => {
mockRippled.addResponse("account_objects", rippled.account_objects.normal);
const result = await client.request({
command: "account_objects",
account: address,
});
assertResultMatch(
result.result,
responses.getAccountObjects,
"AccountObjectsResponse"
);
},
};
});
});