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 22, 2018
1 parent 53ccd4b commit 6de98a2
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/default-datastore.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

// Default configuration for the datastore spec in node.js
module.exports = {
StorageMax: '10GB',
StorageGCWatermark: 90,
GCPeriod: '1h',
BloomFilterSize: 0,
Expand Down
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 6de98a2

Please sign in to comment.