Skip to content
This repository has been archived by the owner on Jun 26, 2023. It is now read-only.

Commit

Permalink
fix: stop pubsub after test (#200)
Browse files Browse the repository at this point in the history
Some pubsub nodes live for longer than the test, shut them down after running the tests.
  • Loading branch information
achingbrain committed Apr 25, 2022
1 parent 71490d2 commit 2d2650c
Showing 1 changed file with 5 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default (common: TestSetup<PubSub, PubSubArgs>) => {

describe('nodes send state on connection', () => {
// Create pubsub nodes and connect them
before(async () => {
beforeEach(async () => {
componentsA = await createComponents()
componentsB = await createComponents()

Expand All @@ -43,7 +43,7 @@ export default (common: TestSetup<PubSub, PubSubArgs>) => {
})

// Make subscriptions prior to nodes connected
before(() => {
beforeEach(() => {
psA.subscribe('Za')
psB.subscribe('Zb')

Expand All @@ -53,8 +53,9 @@ export default (common: TestSetup<PubSub, PubSubArgs>) => {
expect(psB.getTopics()).to.deep.equal(['Zb'])
})

after(async () => {
afterEach(async () => {
sinon.restore()
await stop(psA, psB)
await common.teardown()
})

Expand Down Expand Up @@ -104,7 +105,7 @@ export default (common: TestSetup<PubSub, PubSubArgs>) => {

afterEach(async () => {
sinon.restore()

await stop(psA, psB)
await common.teardown()
})

Expand Down Expand Up @@ -174,9 +175,7 @@ export default (common: TestSetup<PubSub, PubSubArgs>) => {

afterEach(async () => {
sinon.restore()

await stop(psA, psB)

await common.teardown()
})

Expand Down Expand Up @@ -257,9 +256,7 @@ export default (common: TestSetup<PubSub, PubSubArgs>) => {

afterEach(async () => {
sinon.restore()

await stop(psA, psB)

await common.teardown()
})

Expand Down

0 comments on commit 2d2650c

Please sign in to comment.