Skip to content
This repository was archived by the owner on Mar 23, 2021. It is now read-only.

Commit 083b20c

Browse files
committed
Terminate cnd in new e2e format
1 parent f2f19b2 commit 083b20c

File tree

3 files changed

+44
-8
lines changed

3 files changed

+44
-8
lines changed

api_tests/e2e/rfc003/btc_eth/cnd_can_be_restarted.ts

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,29 @@
1+
import { Actor } from "../../../lib_sdk/actors/actor";
12
import { createActors } from "../../../lib_sdk/create_actors";
23

34
setTimeout(function() {
5+
let alice: Actor;
6+
let bob: Actor;
7+
8+
beforeEach(async function() {
9+
this.timeout(20000);
10+
const actors = await createActors("cnd_can_be_restarted.log");
11+
alice = actors.alice;
12+
bob = actors.bob;
13+
});
14+
15+
afterEach(() => {
16+
if (alice) {
17+
alice.stop();
18+
}
19+
if (bob) {
20+
bob.stop();
21+
}
22+
});
23+
424
describe("cnd can be restarted", function() {
525
this.timeout(60000);
626
it("after the swap was accepted", async function() {
7-
const { alice, bob } = await createActors(
8-
"cnd_can_be_restarted.log"
9-
);
10-
1127
await alice.sendRequest();
1228
await bob.accept();
1329

api_tests/e2e/rfc003/btc_eth/happy.ts

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,30 @@
1+
import { Actor } from "../../../lib_sdk/actors/actor";
12
import { AssetKind } from "../../../lib_sdk/asset";
23
import { createActors } from "../../../lib_sdk/create_actors";
34

45
setTimeout(function() {
6+
let alice: Actor;
7+
let bob: Actor;
8+
9+
beforeEach(async function() {
10+
this.timeout(20000);
11+
const actors = await createActors("e2e-rfc003-btc-eth-happy.log");
12+
alice = actors.alice;
13+
bob = actors.bob;
14+
});
15+
16+
afterEach(() => {
17+
if (alice) {
18+
alice.stop();
19+
}
20+
if (bob) {
21+
bob.stop();
22+
}
23+
});
24+
525
describe("happy path", function() {
626
this.timeout(60000);
727
it("bitcoin ether", async function() {
8-
const { alice, bob } = await createActors(
9-
"e2e-rfc003-btc-eth-happy.log"
10-
);
11-
1228
await alice.sendRequest(AssetKind.Bitcoin, AssetKind.Ether);
1329
await bob.accept();
1430
await alice.fund();

api_tests/lib_sdk/actors/actor.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,10 @@ export class Actor {
244244
await this.cndInstance.start();
245245
}
246246

247+
public stop() {
248+
this.cndInstance.stop();
249+
}
250+
247251
private async additionalIdentities(
248252
alphaAsset: AssetKind,
249253
betaAsset: AssetKind

0 commit comments

Comments
 (0)