Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Commit

Permalink
fix: removed hard-coded timeout on test and liting fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pgte committed Mar 28, 2017
1 parent f1eb595 commit 0a3bbcb
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions test/core/files-sharding.spec.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
/* eslint max-nested-callbacks: ["error", 8] */
/* eslint-env mocha */
'use strict'

const expect = require('chai').expect
const chai = require('chai')
const dirtyChai = require('dirty-chai')
const expect = chai.expect
chai.use(dirtyChai)
const pull = require('pull-stream')

const IPFS = require('../../src/core')
const createTempRepo = require('../utils/create-repo-node.js')

describe('files dir', () => {

const files = []
for(let i = 0; i < 1005; i++) {
for (let i = 0; i < 1005; i++) {
files.push({
path: 'test-folder/' + i,
content: new Buffer('some content ' + i)
Expand Down Expand Up @@ -38,6 +42,7 @@ describe('files dir', () => {
pull.values(files),
ipfs.files.createAddPullStream(),
pull.collect((err, results) => {
expect(err).to.not.exist()
const last = results[results.length - 1]
expect(last.path).to.be.eql('test-folder')
expect(last.hash).to.be.eql('QmWWM8ZV6GPhqJ46WtKcUaBPNHN5yQaFsKDSQ1RE73w94Q')
Expand All @@ -48,8 +53,7 @@ describe('files dir', () => {
after((done) => {
ipfs.stop(() => done()) // ignore stop errors
})

}).timeout(4000)
})
})

describe('with sharding', () => {
Expand Down Expand Up @@ -77,13 +81,13 @@ describe('files dir', () => {
pull.values(files),
ipfs.files.createAddPullStream(),
pull.collect((err, results) => {
expect(err).to.not.exist()
const last = results[results.length - 1]
expect(last.path).to.be.eql('test-folder')
expect(last.hash).to.be.eql('QmZjYC1kWrLmiRYbEmGSo2PEpMixzT2k2xoCKSBzt8KDcy')
done()
})
)

}).timeout(4000)
})
})
})

0 comments on commit 0a3bbcb

Please sign in to comment.