This repository was archived by the owner on Feb 12, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +10
-16
lines changed Expand file tree Collapse file tree 3 files changed +10
-16
lines changed Original file line number Diff line number Diff line change 47
47
"form-data" : " ^1.0.0-rc4" ,
48
48
"gulp" : " ^3.9.1" ,
49
49
"idb-plus-blob-store" : " ^1.1.2" ,
50
- "interface-ipfs-core" : " ^0.6 .0" ,
50
+ "interface-ipfs-core" : " ^0.7 .0" ,
51
51
"left-pad" : " ^1.1.1" ,
52
52
"lodash" : " ^4.14.1" ,
53
53
"ncp" : " ^2.0.0" ,
121
121
" kumavis <kumavis@users.noreply.github.com>" ,
122
122
" nginnever <ginneversource@gmail.com>"
123
123
]
124
- }
124
+ }
Original file line number Diff line number Diff line change 2
2
'use strict'
3
3
4
4
const test = require ( 'interface-ipfs-core' )
5
- const IPFS = require ( '../../../src/core ' )
5
+ const IPFSFactory = require ( '../../utils/factory ' )
6
6
7
- // let factory
7
+ let factory
8
8
9
9
const common = {
10
10
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 )
16
13
} ,
17
14
teardown : function ( cb ) {
18
- // factory.teardown
19
- cb ( )
15
+ factory . dismantle ( cb )
20
16
}
21
17
}
22
18
Original file line number Diff line number Diff line change 1
1
'use strict'
2
2
3
- const fs = require ( 'fs' )
4
- const path = require ( 'path' )
5
3
const PeerId = require ( 'peer-id' )
6
4
const isNode = require ( 'detect-node' )
7
5
const IPFSRepo = require ( 'ipfs-repo' )
8
6
const cleanRepo = require ( '../clean' )
9
7
const IPFS = require ( '../../../src/core' )
10
8
const series = require ( 'run-series' )
9
+ const defaultConfig = require ( './default-config.json' )
11
10
12
11
module . exports = Factory
13
12
@@ -36,9 +35,8 @@ function Factory () {
36
35
}
37
36
38
37
if ( ! config ) {
39
- const defaultConfigPath = path . join ( __dirname , 'default-config.json' )
40
- config = JSON . parse ( fs . readFileSync ( defaultConfigPath ) . toString ( ) )
41
- const pId = PeerId . create ( ) . toJSON ( )
38
+ config = JSON . parse ( JSON . stringify ( defaultConfig ) )
39
+ const pId = PeerId . create ( { bits : 32 } ) . toJSON ( )
42
40
config . Identity . PeerID = pId . id
43
41
config . Identity . PrivKey = pId . privKey
44
42
}
You can’t perform that action at this time.
0 commit comments