postchain-client
Version:
Client library for accessing a Postchain node through REST.
30 lines • 1.67 kB
JavaScript
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
import { exampleTxHashString, mockTransactionReceipts } from "../../common/mocks";
import { getTestsClient } from "../../common/setups";
import { server } from "../../../mocks/servers";
let client;
describe("getWaitingTransactions", () => {
beforeAll(() => __awaiter(void 0, void 0, void 0, function* () {
server.listen();
client = yield getTestsClient();
}));
afterEach(() => __awaiter(void 0, void 0, void 0, function* () {
server.resetHandlers();
}));
it("returns waiting transactions for blockchain", () => __awaiter(void 0, void 0, void 0, function* () {
jest
.spyOn(client, "signAndSendUniqueTransaction")
.mockResolvedValue(mockTransactionReceipts.waiting);
const waitingTransactions = yield client.getWaitingTransactions(client.config.blockchainRid);
expect(waitingTransactions).toEqual([exampleTxHashString]);
}));
});
//# sourceMappingURL=client.getWaitingTransactions.test.js.map