Skip to content

Commit

Permalink
fix: interoperability with go repo - added tests
Browse files Browse the repository at this point in the history
  • Loading branch information
vasco-santos committed Jul 21, 2018
1 parent 53ccd4b commit 87287c0
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test/repo-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,26 @@ module.exports = (repo) => {
})
})

describe('spec', () => {
it('get spec', (done) => {
repo.spec.get((err) => {
expect(err).to.not.exist()
done()
})
})

it('set spec', (done) => {
series([
(cb) => repo.spec.set({ a: 'b' }, cb),
(cb) => repo.spec.get((err, spec) => {
if (err) return cb(err)
expect(spec).to.deep.equal({ a: 'b' })
cb()
})
], done)
})
})

describe('version', () => {
it('get version', (done) => {
repo.version.get((err, version) => {
Expand Down
1 change: 1 addition & 0 deletions test/test-repo/datastore_spec
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"mounts":[{"mountpoint":"/blocks","path":"blocks","shardFunc":"/repo/flatfs/shard/v1/next-to-last/2","type":"flatfs"},{"mountpoint":"/","path":"datastore","type":"levelds"}],"type":"mount"}

0 comments on commit 87287c0

Please sign in to comment.