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

Commit 37656da

Browse files
author
Alan Shaw
committed
fix: call api method that requires node to be started
1 parent cb9700d commit 37656da

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/miscellaneous/stop.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,14 @@ module.exports = (common, options) => {
1818
it('should stop the node', async () => {
1919
const ipfs = await common.spawn()
2020

21+
// Should succeed because node is started
22+
await ipfs.api.swarm.peers()
23+
24+
// Stop the node and try the call again
2125
await ipfs.stop()
22-
// Trying to stop an already stopped node should return an error
23-
// as the node can't respond to requests anymore
24-
return expect(ipfs.api.stop()).to.eventually.be.rejected()
26+
27+
// Trying to use an API that requires a started node should return an error
28+
return expect(ipfs.api.swarm.peers()).to.eventually.be.rejected()
2529
})
2630
})
2731
}

0 commit comments

Comments
 (0)