mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-12-02 01:55:48 +00:00
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:
@@ -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"
|
||||
);
|
||||
},
|
||||
};
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user