diff --git a/index.js b/index.js index 386c8550..3e793628 100644 --- a/index.js +++ b/index.js @@ -131,7 +131,7 @@ module.exports = class Autobase extends ReadyResource { this.system = null this.version = -1 - this.maxCacheSize = handlers.maxCacheSize || null + this.maxCacheSize = handlers.maxCacheSize || 0 // 0 means the hyperbee default cache size will be used const { ackInterval = DEFAULT_ACK_INTERVAL, diff --git a/test/basic.js b/test/basic.js index 646f5bce..aa2771a1 100644 --- a/test/basic.js +++ b/test/basic.js @@ -1589,11 +1589,11 @@ test('basic - maxCacheSize opt', async t => { t.is(base.system.db.maxCacheSize, 10, 'maxCacheSize applied to sys db') }) -test('basic - maxCacheSize has null default', async t => { +test('basic - maxCacheSize has 0 default', async t => { const [store] = await createStores(1, t) const base = new Autobase(store.namespace('with-cache')) await base.ready() - t.is(base.maxCacheSize, null, 'maxCacheSize default null') + t.is(base.maxCacheSize, 0, 'maxCacheSize default 0') }) // todo: this test is hard, probably have to rely on ff to recover