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

Commit d71962c

Browse files
author
Alan Shaw
committed
fix: better check for envs where not addrs
1 parent a19ea64 commit d71962c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/swarm/local-addrs.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* eslint-env mocha */
22
'use strict'
33

4-
const { isNode } = require('ipfs-utils/src/env')
4+
const { isBrowser, isWebWorker } = require('ipfs-utils/src/env')
55
const { getDescribe, getIt, expect } = require('../utils/mocha')
66

77
/** @typedef { import("ipfsd-ctl/src/factory") } Factory */
@@ -26,10 +26,10 @@ module.exports = (common, options) => {
2626

2727
it('should list local addresses the node is listening on', async () => {
2828
const multiaddrs = await ipfs.swarm.localAddrs()
29-
if (isNode) {
30-
expect(multiaddrs).to.have.length.above(0)
31-
} else {
29+
if (isBrowser || isWebWorker) {
3230
expect(multiaddrs).to.have.length(0)
31+
} else {
32+
expect(multiaddrs).to.have.length.above(0)
3333
}
3434
})
3535
})

0 commit comments

Comments
 (0)