chore: run node tests in ci (#1057)

Looks like this project stopped running the `test:node` npm script when it was migrated to gh actions.

Re-enable it and fix all the related test failures.
This commit is contained in:
Alex Potsides
2021-12-08 08:38:17 +00:00
committed by GitHub
parent b539f9b655
commit 1b46f47fdb
21 changed files with 155 additions and 138 deletions

View File

@ -38,13 +38,13 @@ describe('DHT subsystem is configurable', () => {
})
libp2p = await create(customOptions)
expect(libp2p._dht.isStarted).to.equal(false)
expect(libp2p._dht.isStarted()).to.equal(false)
await libp2p.start()
expect(libp2p._dht.isStarted).to.equal(true)
expect(libp2p._dht.isStarted()).to.equal(true)
await libp2p.stop()
expect(libp2p._dht.isStarted).to.equal(false)
expect(libp2p._dht.isStarted()).to.equal(false)
})
it('should not start if disabled once libp2p starts', async () => {
@ -63,10 +63,10 @@ describe('DHT subsystem is configurable', () => {
})
libp2p = await create(customOptions)
expect(libp2p._dht.isStarted).to.equal(false)
expect(libp2p._dht.isStarted()).to.equal(false)
await libp2p.start()
expect(libp2p._dht.isStarted).to.equal(false)
expect(libp2p._dht.isStarted()).to.equal(false)
})
it('should allow a manual start', async () => {
@ -86,9 +86,9 @@ describe('DHT subsystem is configurable', () => {
libp2p = await create(customOptions)
await libp2p.start()
expect(libp2p._dht.isStarted).to.equal(false)
expect(libp2p._dht.isStarted()).to.equal(false)
await libp2p._dht.start()
expect(libp2p._dht.isStarted).to.equal(true)
expect(libp2p._dht.isStarted()).to.equal(true)
})
})