Skip to content
This repository was archived by the owner on Feb 12, 2024. It is now read-only.

Commit b152856

Browse files
committed
fix: removes error code checks for bitswap offline tests
When run in the browser with js-ipfs-api against a stopped go-ipfs there is no error code, just a "Failed to fetch" message from the browser fetch API. The error `code` is specific to Node.js so this check has been removed. License: MIT Signed-off-by: Alan Shaw <[email protected]>
1 parent 66c53f7 commit b152856

File tree

1 file changed

+0
-15
lines changed

1 file changed

+0
-15
lines changed

js/src/bitswap.js

-15
Original file line numberDiff line numberDiff line change
@@ -120,11 +120,6 @@ module.exports = (common) => {
120120
it('.stat gives error while offline', (done) => {
121121
ipfs.bitswap.stat((err, stats) => {
122122
expect(err).to.exist()
123-
// When run against core we get our expected error, when run
124-
// as part of the http tests we get a connection refused
125-
if (err.code !== 'ECONNREFUSED') {
126-
expect(err).to.match(/online mode/)
127-
}
128123
expect(stats).to.not.exist()
129124
done()
130125
})
@@ -133,11 +128,6 @@ module.exports = (common) => {
133128
it('.wantlist gives error if offline', (done) => {
134129
ipfs.bitswap.wantlist((err, list) => {
135130
expect(err).to.exist()
136-
// When run against core we get our expected error, when run
137-
// as part of the http tests we get a connection refused
138-
if (err.code !== 'ECONNREFUSED') {
139-
expect(err).to.match(/online mode/)
140-
}
141131
expect(list).to.not.exist()
142132
done()
143133
})
@@ -147,11 +137,6 @@ module.exports = (common) => {
147137
const key = 'QmUBdnXXPyoDFXj3Hj39dNJ5VkN3QFRskXxcGaYFBB8CNR'
148138
ipfs.bitswap.unwant(key, (err) => {
149139
expect(err).to.exist()
150-
// When run against core we get our expected error, when run
151-
// as part of the http tests we get a connection refused
152-
if (err.code !== 'ECONNREFUSED') {
153-
expect(err).to.match(/online mode/)
154-
}
155140
done()
156141
})
157142
})

0 commit comments

Comments
 (0)