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

fix: adds tests for ipfs name #974

Merged
merged 8 commits into from
Jun 20, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.