From 69e1591829f06c19fa7e5df4ac4c12b0f6082dba Mon Sep 17 00:00:00 2001 From: shamb0t Date: Tue, 19 Nov 2019 15:49:12 +0000 Subject: [PATCH] update tests --- package-lock.json | 24 ++++++++++++------------ package.json | 4 ++-- test/docstore.test.js | 3 ++- test/v0-open-load.js | 4 ++-- 4 files changed, 18 insertions(+), 17 deletions(-) diff --git a/package-lock.json b/package-lock.json index f54b051..ebafe85 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9550,8 +9550,8 @@ } }, "ipfs-log": { - "version": "github:orbitdb/ipfs-log#eec15778d340a50ee2b57c63bea4edaf920c1984", - "from": "github:orbitdb/ipfs-log#feat/load-opt", + "version": "github:orbitdb/ipfs-log#8e8bf195b6bc6bc91b8a8f3d19899b824899dd42", + "from": "github:orbitdb/ipfs-log#feat/bc", "requires": { "cids": "~0.7.1", "ipld-dag-pb": "^0.17.4", @@ -14201,7 +14201,7 @@ } }, "orbit-db-io": { - "version": "github:orbitdb/orbit-db-io#b82c774f98d18a9fe6bc65f9ae7bf8015cf2b8aa", + "version": "github:orbitdb/orbit-db-io#da180fdbcff825e830022dd1a2110bbb1ed4736b", "from": "github:orbitdb/orbit-db-io", "requires": { "cids": "^0.7.1", @@ -14268,10 +14268,10 @@ } }, "orbit-db-store": { - "version": "github:orbitdb/orbit-db-store#59dcd4905eed18ed10e91aed5e2fcd7d1bdb32eb", - "from": "github:orbitdb/orbit-db-store", + "version": "github:orbitdb/orbit-db-store#6c9cc05a735bd0bc9a5bc9df4da36eedda6a2db6", + "from": "github:orbitdb/orbit-db-store#feat/bc", "requires": { - "ipfs-log": "~4.4.0", + "ipfs-log": "github:orbitdb/ipfs-log#feat/bc", "logplease": "^1.2.14", "orbit-db-io": "~0.1.1", "p-each-series": "^1.0.0", @@ -20374,9 +20374,9 @@ "dev": true }, "which": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.1.tgz", - "integrity": "sha512-N7GBZOTswtB9lkQBZA4+zAXrjEIWAUOB93AvzUiudRzRxhUdLURQ7D/gAIMY1gatT/LTbmbcv8SiYazy3eYB7w==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", "dev": true, "requires": { "isexe": "^2.0.0" @@ -20744,9 +20744,9 @@ "dev": true }, "yargs": { - "version": "14.2.1", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-14.2.1.tgz", - "integrity": "sha512-rZ00XIuGAoI58F0weHyCP3PAN17wJqdN/pF8eMp+imuP+jSdMCD5t4bSf5d5FKPvEDrK9zYlnhO7bFYKQ5UYow==", + "version": "14.2.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-14.2.2.tgz", + "integrity": "sha512-/4ld+4VV5RnrynMhPZJ/ZpOCGSCeghMykZ3BhdFBDa9Wy/RH6uEGNWDJog+aUlq+9OM1CFTgtYRW5Is1Po9NOA==", "dev": true, "requires": { "cliui": "^5.0.0", diff --git a/package.json b/package.json index 3fadba0..4290a6d 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "main": "src/OrbitDB.js", "dependencies": { "cids": "^0.7.1", - "ipfs-log": "orbitdb/ipfs-log#feat/load-opt", + "ipfs-log": "orbitdb/ipfs-log#feat/bc", "ipfs-pubsub-1on1": "~0.0.6", "is-node": "^1.0.2", "localstorage-down": "^0.6.7", @@ -32,7 +32,7 @@ "orbit-db-kvstore": "~1.6.0", "orbit-db-pubsub": "~0.5.5", "orbit-db-storage-adapter": "^0.5.3", - "orbit-db-store": "orbitdb/orbit-db-store" + "orbit-db-store": "orbitdb/orbit-db-store#feat/bc" }, "devDependencies": { "babel-cli": "^6.26.0", diff --git a/test/docstore.test.js b/test/docstore.test.js index a1ad414..2870c46 100644 --- a/test/docstore.test.js +++ b/test/docstore.test.js @@ -161,7 +161,8 @@ Object.keys(testAPIs).forEach(API => { assert.deepEqual(res.payload, expectedOperation) assert.notEqual(res.next, undefined) assert.equal(res.next.length, 1) - assert.equal(res.v, 1) + assert.equal(res.refs.length, 0) + assert.equal(res.v, 2) assert.notEqual(res.clock, undefined) assert.equal(res.clock.time, 2) assert.notEqual(res.key, undefined) diff --git a/test/v0-open-load.js b/test/v0-open-load.js index b2cbb8e..70d9524 100644 --- a/test/v0-open-load.js +++ b/test/v0-open-load.js @@ -45,7 +45,7 @@ Object.keys(testAPIs).forEach(API => { ipfsd = await startIpfs(API, config.daemon1) ipfs = ipfsd.api rmrf.sync(dbPath) - + const filterFunc = (src, dest) => { // windows has problems copying these files... return !(src.includes('LOG') || src.includes('LOCK')) @@ -123,7 +123,7 @@ Object.keys(testAPIs).forEach(API => { it('allows migrated key to write', async () => { const hash = await db.add({ thing: 'new addition' }) - const newEntries = db.all.filter(e => e.v === 1) + const newEntries = db.all.filter(e => e.v > 0) assert.equal(newEntries.length, 1) assert.strictEqual(newEntries[0].hash, hash) })