Skip to content

Commit 6de98a2

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

File tree

3 files changed

+21
-1
lines changed

3 files changed

+21
-1
lines changed

src/default-datastore.js

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
// Default configuration for the datastore spec in node.js
44
module.exports = {
5-
StorageMax: '10GB',
65
StorageGCWatermark: 90,
76
GCPeriod: '1h',
87
BloomFilterSize: 0,

test/repo-test.js

+20
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

+1
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)