Skip to content
This repository was archived by the owner on Feb 12, 2024. It is now read-only.

Commit 6511617

Browse files
committed
feat(factory): add ipfs factory to files
1 parent b1ac7ba commit 6511617

File tree

3 files changed

+9
-12
lines changed

3 files changed

+9
-12
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"form-data": "^1.0.0-rc4",
4848
"gulp": "^3.9.1",
4949
"idb-plus-blob-store": "^1.1.2",
50-
"interface-ipfs-core": "^0.6.0",
50+
"interface-ipfs-core": "^0.7.0",
5151
"left-pad": "^1.1.1",
5252
"lodash": "^4.14.1",
5353
"ncp": "^2.0.0",
@@ -117,4 +117,4 @@
117117
"kumavis <[email protected]>",
118118
"nginnever <[email protected]>"
119119
]
120-
}
120+
}

test/core/both/test-files.js

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,17 @@
22
'use strict'
33

44
const test = require('interface-ipfs-core')
5-
const IPFS = require('../../../src/core')
5+
const IPFSFactory = require('../../utils/factory')
66

7-
// let factory
7+
let factory
88

99
const common = {
1010
setup: function (cb) {
11-
// TODO change to factory
12-
const ipfs = new IPFS(require('../../utils/repo-path'))
13-
ipfs.load(() => {
14-
cb(null, ipfs)
15-
})
11+
factory = new IPFSFactory()
12+
cb(null, factory)
1613
},
1714
teardown: function (cb) {
18-
// factory.teardown
19-
cb()
15+
factory.dismantle(cb)
2016
}
2117
}
2218

test/utils/factory/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ function Factory () {
3737

3838
if (!config) {
3939
const defaultConfigPath = path.join(__dirname, 'default-config.json')
40-
config = JSON.parse(fs.readFileSync(defaultConfigPath).toString())
40+
config = fs.readFileSync(defaultConfigPath)
41+
config = JSON.parse(config.toString())
4142
const pId = PeerId.create().toJSON()
4243
config.Identity.PeerID = pId.id
4344
config.Identity.PrivKey = pId.privKey

0 commit comments

Comments
 (0)