From dd8fa5385d83c3e9dbb586369a5d30a564bf0991 Mon Sep 17 00:00:00 2001 From: Steven Vandevelde Date: Wed, 27 Jan 2021 19:14:21 +0100 Subject: [PATCH] chore: add interface-ipfs-core tests for pin to ipfs-message-port-client --- .../test/interface-message-port-client.js | 171 +++++++++++++++++- 1 file changed, 166 insertions(+), 5 deletions(-) diff --git a/packages/ipfs-message-port-client/test/interface-message-port-client.js b/packages/ipfs-message-port-client/test/interface-message-port-client.js index 9381c955dd..6e21a78edb 100644 --- a/packages/ipfs-message-port-client/test/interface-message-port-client.js +++ b/packages/ipfs-message-port-client/test/interface-message-port-client.js @@ -148,11 +148,6 @@ describe('interface-ipfs-core tests', () => { name: 'should remove by CID in buffer', reason: 'Passing CID as Buffer is not supported' }, - { - name: 'should error when removing pinned blocks', - reason: 'ipfs.pin.add is not implemented' - }, - { name: 'should remove multiple CIDs', reason: 'times out' @@ -167,4 +162,170 @@ describe('interface-ipfs-core tests', () => { } ] }) + + tests.pin(factory, { + skip: [ + // pin.add + { + name: 'should add a CID and return the added CID', + reason: 'ipfs.pin.ls is not implemented' + }, + { + name: 'should add a pin with options and return the added CID', + reason: 'ipfs.pin.ls is not implemented' + }, + { + name: 'should add recursively', + reason: 'ipfs.pin.ls is not implemented' + }, + { + name: 'should add directly', + reason: 'ipfs.pin.ls is not implemented' + }, + { + name: 'should recursively pin parent of direct pin', + reason: 'ipfs.pin.ls is not implemented' + }, + { + name: 'should fail to directly pin a recursive pin', + reason: 'ipfs.pin.ls is not implemented' + }, + { + name: 'should fail to pin a hash not in datastore', + reason: 'ipfs.pin.ls is not implemented' + }, + { + name: 'needs all children in datastore to pin recursively', + reason: 'ipfs.pin.ls is not implemented' + }, + { + name: 'should pin dag-cbor', + reason: 'ipfs.pin.ls is not implemented' + }, + { + name: 'should pin raw', + reason: 'ipfs.pin.ls is not implemented' + }, + { + name: 'should pin dag-cbor with dag-pb child', + reason: 'ipfs.pin.ls is not implemented' + }, + // pin.addAll + { + name: 'should add an array of CIDs', + reason: 'ipfs.pin.addAll is not implemented' + }, + { + name: 'should add a generator of CIDs', + reason: 'ipfs.pin.addAll is not implemented' + }, + { + name: 'should add an async generator of CIDs', + reason: 'ipfs.pin.addAll is not implemented' + }, + { + name: 'should add an array of pins with options', + reason: 'ipfs.pin.addAll is not implemented' + }, + { + name: 'should add a generator of pins with options', + reason: 'ipfs.pin.addAll is not implemented' + }, + { + name: 'should add an async generator of pins with options', + reason: 'ipfs.pin.addAll is not implemented' + }, + { + name: 'should respect timeout option when pinning a block', + reason: 'ipfs.pin.addAll is not implemented' + }, + // pin.ls + { + name: 'should respect timeout option when listing pins', + reason: 'ipfs.pin.ls is not implemented' + }, + { + name: 'should list all recursive pins', + reason: 'ipfs.pin.ls is not implemented' + }, + { + name: 'should list all indirect pins', + reason: 'ipfs.pin.ls is not implemented' + }, + { + name: 'should list all types of pins', + reason: 'ipfs.pin.ls is not implemented' + }, + { + name: 'should list all direct pins', + reason: 'ipfs.pin.ls is not implemented' + }, + { + name: 'should list pins for a specific hash', + reason: 'ipfs.pin.ls is not implemented' + }, + { + name: 'should throw an error on missing direct pins for existing path', + reason: 'ipfs.pin.ls is not implemented' + }, + { + name: 'should throw an error on missing link for a specific path', + reason: 'ipfs.pin.ls is not implemented' + }, + { + name: 'should list indirect pins for a specific path', + reason: 'ipfs.pin.ls is not implemented' + }, + { + name: 'should list recursive pins for a specific hash', + reason: 'ipfs.pin.ls is not implemented' + }, + { + name: 'should list pins for multiple CIDs', + reason: 'ipfs.pin.ls is not implemented' + }, + { + name: 'should throw error for invalid non-string pin type option', + reason: 'ipfs.pin.ls is not implemented' + }, + { + name: 'should throw error for invalid string pin type option', + reason: 'ipfs.pin.ls is not implemented' + }, + { + name: 'should list pins with metadata', + reason: 'ipfs.pin.ls is not implemented' + }, + // pin.rm + { + name: 'should respect timeout option when unpinning a block', + reason: 'ipfs.pin.rm is not implemented' + }, + { + name: 'should remove a recursive pin', + reason: 'ipfs.pin.rm is not implemented' + }, + { + name: 'should remove a direct pin', + reason: 'ipfs.pin.rm is not implemented' + }, + { + name: 'should fail to remove an indirect pin', + reason: 'ipfs.pin.rm is not implemented' + }, + { + name: 'should fail when an item is not pinned', + reason: 'ipfs.pin.rm is not implemented' + }, + // pin.rmAll + { + name: 'should respect timeout option when unpinning a block', + reason: 'ipfs.pin.rmAll is not implemented' + }, + { + name: 'should pipe the output of ls to rm', + reason: 'ipfs.pin.rmAll is not implemented' + }, + ] + }) })