Closed cdeng001 closed 5 years ago
yeah, lmk if i missed or messed anything up
const res = await ipfs.saveProofToIpfs("peaches");
expect(res)
.to.be.an.instanceOf(Array)
.that.has.same.deep.members([{ hash: "sneaky peaches" }]);
using done would refractor to
ipfs.saveProofToIpfs("peaches")
.then((res) => {
expect(res)
.to.be.an.instanceOf(Array)
.that.has.same.deep.members([{ hash: "sneaky peaches" }]);
} ).then(() => {
done()
})
is this correct?
You can just call done after the expect()
and not use a second .then()
its good practice to add a .catch((ex) => { expect(ex).to.not.exist() })
weird, doing that doesn't change the output of the tests the log messages are still popping up synchronously
I think that mocha handles returned promises and since async always returns a promise, the test gets handled automatically without a done() call.
I just noticed you have not added any of the calls to
done()
. see: https://github.com/IBM/ipfs-social-proof/blob/master/test/remote-proofs.spec.js#L51-L66