js-waku/packages/tests/src/teardown.ts
fbarbu15 e284c78701
chore: new lightpush tests (#1571)
* new lightpush tests

* fixes after CI run

* split tests into 2 files

* small fix

* address code review comments

* small fix after CI run

---------

Co-authored-by: Danish Arora <35004822+danisharora099@users.noreply.github.com>
2023-09-19 15:51:03 +05:30

24 lines
495 B
TypeScript

import { LightNode } from "@waku/interfaces";
import debug from "debug";
import { NimGoNode } from "./index.js";
const log = debug("waku:test");
export function tearDownNodes(
nwakuNodes: NimGoNode[],
wakuNodes: LightNode[]
): void {
nwakuNodes.forEach((nwaku) => {
if (nwaku) {
nwaku.stop().catch((e) => log("Nwaku failed to stop", e));
}
});
wakuNodes.forEach((waku) => {
if (waku) {
waku.stop().catch((e) => log("Waku failed to stop", e));
}
});
}