Skip to content

Commit 87287c0

Browse files
committed
fix: interoperability with go repo - added tests
1 parent 53ccd4b commit 87287c0

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

test/repo-test.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,26 @@ module.exports = (repo) => {
6161
})
6262
})
6363

64+
describe('spec', () => {
65+
it('get spec', (done) => {
66+
repo.spec.get((err) => {
67+
expect(err).to.not.exist()
68+
done()
69+
})
70+
})
71+
72+
it('set spec', (done) => {
73+
series([
74+
(cb) => repo.spec.set({ a: 'b' }, cb),
75+
(cb) => repo.spec.get((err, spec) => {
76+
if (err) return cb(err)
77+
expect(spec).to.deep.equal({ a: 'b' })
78+
cb()
79+
})
80+
], done)
81+
})
82+
})
83+
6484
describe('version', () => {
6585
it('get version', (done) => {
6686
repo.version.get((err, version) => {

test/test-repo/datastore_spec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
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 commit comments

Comments
 (0)