diff --git a/test/db/keyvalue-persisted.js b/test/db/keyvalue-persisted.js index ecea1a0..8c30f64 100644 --- a/test/db/keyvalue-persisted.js +++ b/test/db/keyvalue-persisted.js @@ -1,4 +1,6 @@ import { deepStrictEqual, strictEqual } from 'assert' +import path from 'path' +import fs from 'fs' import rmrf from 'rimraf' import { copy } from 'fs-extra' import * as IPFS from 'ipfs' @@ -59,6 +61,12 @@ describe('KeyValuePersisted Database', function () { strictEqual(db.type, 'keyvalue') }) + it('creates a directory for the persisted index', async () => { + const expectedPath = path.join('./orbitdb', `./${db.address}`, '/_index') + const directoryExists = fs.existsSync(expectedPath) + strictEqual(directoryExists, true) + }) + it('returns 0 items when it\'s a fresh database', async () => { const all = [] for await (const item of db.iterator()) {