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

Commit 0078ac6

Browse files
committed
adds test for empty repo
1 parent 15f871e commit 0078ac6

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

tests/test-core/test-init-node.js

+15-2
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ function createTestRepo () {
5555
describe('node: init', function () {
5656
this.timeout(10000)
5757

58-
it('basic', (done) => {
58+
it('init docs written', (done) => {
5959
var repo = createTestRepo()
6060
const ipfs = new IPFS(repo)
6161
ipfs.init({ bits: 64 }, (err) => {
@@ -72,5 +72,18 @@ describe('node: init', function () {
7272
})
7373
})
7474

75-
// test --empty-repo
75+
it('empty repo', (done) => {
76+
var repo = createTestRepo()
77+
const ipfs = new IPFS(repo)
78+
ipfs.init({ bits: 64, emptyRepo: true }, (err) => {
79+
expect(err).to.not.exist
80+
81+
// Check for default assets
82+
var multihash = new Buffer('12205e7c3ce237f936c76faf625e90f7751a9f5eeb048f59873303c215e9cce87599', 'hex')
83+
ipfs.object.get(multihash, {}, (err, node) => {
84+
expect(err).to.exist
85+
repo.teardown(done)
86+
})
87+
})
88+
})
7689
})

0 commit comments

Comments
 (0)