Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(aries): refactor jest test negative test cases #3474

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -177,33 +177,31 @@ describe("Aries connector setup tests", () => {
test("Adding aries agent with invalid inbound url throws error", async () => {
const agentName = `shouldThrow-${uuidV4()}`;

try {
await connector.addAriesAgent({
await expect(
connector.addAriesAgent({
name: agentName,
walletKey: agentName,
indyNetworks: [fakeIndyNetworkConfig],
inboundUrl: "foo",
});
expect("should throw!").toBe(0);
} catch (error) {
log.info(
"Adding aries agent with inbound url 'foo' throws error as expected",
);
}
}),
).rejects.toThrow();

try {
await connector.addAriesAgent({
log.info(
"Adding aries agent with inbound url 'foo' throws error as expected",
);

await expect(
connector.addAriesAgent({
name: agentName,
walletKey: agentName,
indyNetworks: [fakeIndyNetworkConfig],
inboundUrl: "http://127.0.0.1",
});
expect("should throw!").toBe(0);
} catch (error) {
log.info(
"Adding aries agent without inbound url port throws error as expected",
);
}
}),
).rejects.toThrow();

log.info(
"Adding aries agent without inbound url port throws error as expected",
);

const allAgents = await connector.getAgents();
expect(allAgents.length).toBe(0);
Expand Down
Loading