ipfs-coord
Version:
A JS library for helping IPFS peers coordinate, find a common interest, and stay connected around that interest.
30 lines (28 loc) • 465 B
JavaScript
/*
A mocked instance of ipfs, for use in unit tests.
*/
const ipfs = {
id: () => {
return {
id: 'myID',
addresses: ['addr1', 'addr2']
}
},
swarm: {
connect: async () => {},
peers: async () => {
return []
},
disconnect: async () => {}
},
pubsub: {
subscribe: async () => {},
publish: async () => {}
},
config: {
set: () => {},
get: () => {},
getAll: () => {}
}
}
module.exports = ipfs