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

Commit

Permalink
test: adds tests for ipfs name (#974)
Browse files Browse the repository at this point in the history
* fix: adds tests to `ipfs name`

* fix: add correct interface-core

* fix: fix tests and update deps

* fix: remove local name tests

* fix: fix mfs timeout

* fix: skip ping tests that fail with latest go-ipfs

* chore: update interface-ipfs-core dep

* chore: update ctl
  • Loading branch information
hugomrdias authored and Alan Shaw committed Jun 20, 2019
1 parent 806b206 commit fdbfb39
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 110 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@
"chai": "^4.2.0",
"cross-env": "^5.2.0",
"dirty-chai": "^2.0.1",
"go-ipfs-dep": "0.4.19",
"interface-ipfs-core": "~0.103.0",
"ipfsd-ctl": "~0.42.0",
"go-ipfs-dep": "~0.4.21",
"interface-ipfs-core": "~0.105.0",
"ipfsd-ctl": "~0.43.0",
"nock": "^10.0.2",
"stream-equal": "^1.1.1"
},
Expand Down
9 changes: 4 additions & 5 deletions test/files-mfs.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ const HASH_ALGS = [
'sha1',
'sha2-256',
'sha2-512',
'keccak-224',
// 'keccak-224', // go throws
'keccak-256',
'keccak-384',
// 'keccak-384', // go throws
'keccak-512'
]

describe('.files (the MFS API part)', function () {
this.timeout(120 * 1000)
this.timeout(20 * 1000)

let ipfsd
let ipfs
Expand Down Expand Up @@ -95,7 +95,7 @@ describe('.files (the MFS API part)', function () {
})

it('.add with cid-version=1 and raw-leaves=false', (done) => {
const expectedCid = 'zdj7Wh9x6gXdg4UAqhRYnjBTw9eJF7hvzUU4HjpnZXHYQz9jK'
const expectedCid = 'bafybeifogzovjqrcxvgt7g36y7g63hvwvoakledwk4b2fr2dl4wzawpnny'
const options = { 'cid-version': 1, 'raw-leaves': false }

ipfs.add(testfile, options, (err, res) => {
Expand All @@ -109,7 +109,6 @@ describe('.files (the MFS API part)', function () {
})

it('.add with only-hash=true', function () {
this.slow(10 * 1000)
const content = String(Math.random() + Date.now())

return ipfs.add(Buffer.from(content), { onlyHash: true })
Expand Down
23 changes: 22 additions & 1 deletion test/interface.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,12 @@ describe('interface-ipfs-core tests', () => {
]
})

tests.name(CommonFactory.create({
spawnOptions: {
args: ['--offline']
}
}))

// TODO: uncomment after https://github.com/ipfs/interface-ipfs-core/pull/361 being merged and a new release
tests.namePubsub(CommonFactory.create({
spawnOptions: {
Expand All @@ -234,7 +240,22 @@ describe('interface-ipfs-core tests', () => {

tests.pin(defaultCommonFactory)

tests.ping(defaultCommonFactory)
tests.ping(defaultCommonFactory, {
skip: [
{
name: 'should fail when pinging an unknown peer over pull stream',
reason: 'FIXME go-ipfs return success with text: Looking up peer <cid>'
},
{
name: 'should fail when pinging peer that is not available over readable stream',
reason: 'FIXME go-ipfs return success with text: Looking up peer <cid>'
},
{
name: 'should fail when pinging a peer that is not available',
reason: 'FIXME go-ipfs return success with text: Looking up peer <cid>'
}
]
})

tests.pubsub(CommonFactory.create({
spawnOptions: {
Expand Down
101 changes: 0 additions & 101 deletions test/name.spec.js

This file was deleted.

0 comments on commit fdbfb39

Please sign in to comment.