maciej@mkg-lenovo:~/js-ipfs-bitswap$ xvfb-run npm test
> [email protected] test /home/maciej/js-ipfs-bitswap
> aegir test -t node -t browser
Test Node.js
bitswap without DHT
✓ connect 0 -> 1 && 1 -> 2 (89ms)
✓ put a block in 2, fail to get it in 0 (220ms)
bitswap with DHT
✓ connect 0 -> 1 && 1 -> 2 (45ms)
✓ put a block in 2, get it in 0 (1461ms)
bitswap with mocks
receive message
✓ simple block message
✓ simple want message
✓ multi peer (23513ms)
get
✓ fails on requesting empty block
✓ block exists locally
✓ blocks exist locally
✓ getMany
✓ block is added locally afterwards (216ms)
✓ block is sent after local add (1145ms)
✓ double get
unwant
✓ removes blocks that are wanted multiple times
bitswap stats
✓ has initial stats
✓ updates blocks received (508ms)
✓ updates duplicate blocks counters (499ms)
connected to another bitswap
✓ updates stats on transfer (1035ms)
✓ has peer stats (359ms)
Engine
✓ consistent accounting (623ms)
✓ peer is added to peers when message receiver or sent (1050ms)
✓ partner wants then cancels (14285ms)
✓ splits large block messages (896ms)
network
✓ instantiate the network obj
✓ connectTo fail
✓ onPeerConnected success (195ms)
✓ connectTo success
✓ ._receiveMessage success from Bitswap 1.0.0 (234ms)
✓ ._receiveMessage success from Bitswap 1.1.0 (232ms)
✓ .sendMessage on Bitswap 1.1.0 (235ms)
✓ dial to peer on Bitswap 1.0.0 (197ms)
✓ .sendMessage on Bitswap 1.1.0 (324ms)
gen Bitswap network
✓ retrieves local blocks (2835ms)
distributed blocks
time -- 801
✓ with 2 nodes (11191ms)
swarms
- 2 nodes, 2 blocks
- 10 nodes, 2 blocks
- 10 nodes, 10 blocks
- 10 nodes, 20 blocks
- 50 nodes, 2 blocks
- 100 nodes, 2 blocks
- 10 nodes, 100 blocks
Ledger
✓ accounts
Notifications
✓ hasBlock
wantBlock
✓ receive block
✓ unwant block
BitswapMessage
✓ .addEntry - want block
✓ .serializeToBitswap100
✓ .serializeToBitswap110
✓ .deserialize a Bitswap100 Message
✓ .deserialize a Bitswap110 Message
✓ duplicates
✓ .empty
✓ non full wantlist message
.equals
✓ true, same message
✓ false, different entries
BitswapMessageEntry
✓ exposes the wantlist entry properties
✓ allows setting properties on the wantlist entry
go interop
✓ bitswap 1.0.0 message
bitswap 1.1.0 message
- full wantlist message
- one block message
Wantlist
✓ length
✓ entries
✓ sortedEntries
✓ contains
✓ with cidV1
remove
✓ removes with a single ref
✓ removes with multiple refs
✓ ignores non existing removes
WantManager
✓ sends wantlist to all connected peers (10254ms)
MessageQueue
✓ connects and sends messages (205ms)
62 passing (1m)
9 pending
Test Browser
bitswap with mocks
1) "before all" hook
2) "after all" hook
Engine
3) consistent accounting
4) peer is added to peers when message receiver or sent
5) partner wants then cancels
6) splits large block messages
Ledger
✓ accounts (2ms)
Notifications
✓ hasBlock (2ms)
wantBlock
✓ receive block (3ms)
✓ unwant block
BitswapMessage
✓ .addEntry - want block (3ms)
✓ .serializeToBitswap100 (1ms)
✓ .serializeToBitswap110
✓ .deserialize a Bitswap100 Message (5ms)
✓ .deserialize a Bitswap110 Message (4ms)
✓ duplicates
✓ .empty
✓ non full wantlist message
.equals
✓ true, same message (2ms)
✓ false, different entries
BitswapMessageEntry
✓ exposes the wantlist entry properties
✓ allows setting properties on the wantlist entry (1ms)
go interop
✓ bitswap 1.0.0 message (2ms)
bitswap 1.1.0 message
- full wantlist message
- one block message
Wantlist
✓ length
✓ entries
✓ sortedEntries (3ms)
✓ contains
✓ with cidV1 (3ms)
remove
✓ removes with a single ref (1ms)
✓ removes with multiple refs
✓ ignores non existing removes
WantManager
✓ sends wantlist to all connected peers (965ms)
MessageQueue
✓ connects and sends messages (207ms)
27 passing (12s)
2 pending
6 failing
1) bitswap with mocks
"before all" hook:
WriteError: QuotaExceededError
at node_modules/aegir/src/config/karma-webpack-bundle.js:120213:34
at IDBTransaction.tx.onabort (node_modules/aegir/src/config/karma-webpack-bundle.js:37284:5)
2) bitswap with mocks
"after all" hook:
TypeError: Cannot read property 'teardown' of undefined
at Context.after (node_modules/aegir/src/config/karma-webpack-bundle.js:68644:10)
3) Engine
consistent accounting:
Error: Uncaught AssertionError: expected {} to not exist (node_modules/aegir/src/config/karma-webpack-bundle.js:72269)
4) Engine
peer is added to peers when message receiver or sent:
Error: Uncaught AssertionError: expected {} to not exist (node_modules/aegir/src/config/karma-webpack-bundle.js:72269)
5) Engine
partner wants then cancels:
Error: Uncaught AssertionError: expected {} to not exist (node_modules/aegir/src/config/karma-webpack-bundle.js:72269)
6) Engine
splits large block messages:
Error: Uncaught AssertionError: expected {} to not exist (node_modules/aegir/src/config/karma-webpack-bundle.js:72269)
Some tests are failing
Error: Some tests are failing
at Server (/home/maciej/js-ipfs-bitswap/node_modules/aegir/src/test/browser.js:12:16)
at removeAllListeners (/home/maciej/js-ipfs-bitswap/node_modules/karma/lib/server.js:380:7)
at Server.<anonymous> (/home/maciej/js-ipfs-bitswap/node_modules/karma/lib/server.js:391:9)
at Object.onceWrapper (events.js:313:30)
at emitNone (events.js:111:20)
at Server.emit (events.js:208:7)
at emitCloseNT (net.js:1671:8)
at _combinedTickCallback (internal/process/next_tick.js:135:11)
at process._tickCallback (internal/process/next_tick.js:180:9)
npm ERR! Test failed. See above for more details.