Skip to content

Commit e9f4b27

Browse files
Cleanup for dev review
1 parent 5b98464 commit e9f4b27

File tree

4 files changed

+7
-24
lines changed

4 files changed

+7
-24
lines changed

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"test:node": "dignified-test node",
99
"test:browser": "dignified-test browser",
1010
"build": "dignified-build",
11-
"coverage": "istanbul cover --print both -- _mocha test/node.js",
11+
"coverage": "dignified-coverage",
1212
"lint": "dignified-lint",
1313
"release": "dignified-release"
1414
},
@@ -33,7 +33,6 @@
3333
"dignified.js": "^1.0.0",
3434
"fs-blob-store": "^5.2.1",
3535
"idb-plus-blob-store": "^1.0.0",
36-
"istanbul": "^0.4.2",
3736
"local-storage-blob-store": "0.0.3",
3837
"lodash": "^4.6.1",
3938
"ncp": "^2.0.0",

src/stores/config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ exports.setUp = (basePath, blobStore, locks) => {
1717
let result
1818
try {
1919
result = JSON.parse(config.toString())
20-
} catch (error) {
21-
return callback(error)
20+
} catch (err) {
21+
return callback(err)
2222
}
2323
callback(null, result)
2424
}))

test/node.js

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,6 @@ describe('IPFS Repo Tests on on Node.js', () => {
2929
})
3030

3131
const fs = require('fs-blob-store')
32-
const options = {
33-
stores: {
34-
keys: fs,
35-
config: fs,
36-
datastore: fs,
37-
// datastoreLegacy: needs https://github.com/ipfs/js-ipfs-repo/issues/6#issuecomment-164650642
38-
logs: fs,
39-
locks: fs,
40-
version: fs
41-
}
42-
}
43-
const repo = new IPFSRepo(repoPath, options)
32+
const repo = new IPFSRepo(repoPath, {stores: fs})
4433
require('./repo-test')(repo)
4534
})

test/repo-test.js

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,11 @@ const expect = require('chai').expect
66
const base58 = require('bs58')
77
const bl = require('bl')
88
const fs = require('fs')
9+
const join = require('path').join
910

10-
const isNode = !global.window
11+
const fileA = fs.readFileSync(join(__dirname, 'test-repo/blocks/12207028/122070286b9afa6620a66f715c7020d68af3d10e1a497971629c07606bfdb812303d.data'))
1112

12-
const fileA = isNode
13-
? fs.readFileSync(process.cwd() + '/test/test-repo/blocks/12207028/122070286b9afa6620a66f715c7020d68af3d10e1a497971629c07606bfdb812303d.data')
14-
: require('buffer!./test-repo/blocks/12207028/122070286b9afa6620a66f715c7020d68af3d10e1a497971629c07606bfdb812303d.data')
15-
16-
const fileAExt = isNode
17-
? fs.readFileSync(process.cwd() + '/test/test-repo/blocks/12207028/122070286b9afa6620a66f715c7020d68af3d10e1a497971629c07606bfdb812303d.ext')
18-
: require('buffer!./test-repo/blocks/12207028/122070286b9afa6620a66f715c7020d68af3d10e1a497971629c07606bfdb812303d.ext')
13+
const fileAExt = fs.readFileSync(join(__dirname, 'test-repo/blocks/12207028/122070286b9afa6620a66f715c7020d68af3d10e1a497971629c07606bfdb812303d.ext'))
1914

2015
module.exports = function (repo) {
2116
describe('IPFS Repo Tests', function () {

0 commit comments

Comments
 (0)