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

Commit

Permalink
adds test for empty repo
Browse files Browse the repository at this point in the history
  • Loading branch information
hackergrrl committed Mar 22, 2016
1 parent 15f871e commit 0078ac6
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions tests/test-core/test-init-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ function createTestRepo () {
describe('node: init', function () {
this.timeout(10000)

it('basic', (done) => {
it('init docs written', (done) => {
var repo = createTestRepo()
const ipfs = new IPFS(repo)
ipfs.init({ bits: 64 }, (err) => {
Expand All @@ -72,5 +72,18 @@ describe('node: init', function () {
})
})

// test --empty-repo
it('empty repo', (done) => {
var repo = createTestRepo()
const ipfs = new IPFS(repo)
ipfs.init({ bits: 64, emptyRepo: true }, (err) => {
expect(err).to.not.exist

// Check for default assets
var multihash = new Buffer('12205e7c3ce237f936c76faf625e90f7751a9f5eeb048f59873303c215e9cce87599', 'hex')
ipfs.object.get(multihash, {}, (err, node) => {
expect(err).to.exist
repo.teardown(done)
})
})
})
})

0 comments on commit 0078ac6

Please sign in to comment.