@@ -7,18 +7,26 @@ const merge = require('merge-options')
7
7
const ctl = require ( 'ipfsd-ctl' )
8
8
const IPFS = require ( '../../src' )
9
9
10
+ /** @ignore @typedef { import("ipfsd-ctl").FactoryOptions } FactoryOptions */
11
+
10
12
describe ( 'interface-ipfs-core tests' , function ( ) {
13
+ /** @type FactoryOptions */
11
14
const commonOptions = {
12
- factoryOptions : {
13
- type : 'proc' ,
14
- exec : IPFS ,
15
- IpfsClient : require ( 'ipfs-http-client' )
16
- }
15
+ type : 'proc' ,
16
+ ipfsApi : {
17
+ path : require . resolve ( '../../src' ) ,
18
+ ref : IPFS
19
+ } ,
20
+ ipfsHttp : {
21
+ path : require . resolve ( 'ipfs-http-client' ) ,
22
+ ref : require ( 'ipfs-http-client' )
23
+ } ,
24
+ ipfsBin : './src/cli/bin.js'
17
25
}
18
26
const commonFactory = ctl . createTestsInterface ( commonOptions )
19
27
20
28
tests . bitswap ( commonFactory , {
21
- skip : ! isNode ? true : [
29
+ skip : [
22
30
{
23
31
name : 'should get the wantlist by peer ID for a diffreent node' ,
24
32
reason : 'TODO: find the reason'
@@ -53,26 +61,29 @@ describe('interface-ipfs-core tests', function () {
53
61
tests . filesMFS ( commonFactory )
54
62
55
63
tests . key ( ctl . createTestsInterface ( merge ( commonOptions , {
56
- spawnOptions : {
57
- args : [ '--pass' , ' ipfs-is-awesome-software']
64
+ ipfsOptions : {
65
+ pass : ' ipfs-is-awesome-software'
58
66
}
59
67
} ) ) )
60
68
61
69
tests . miscellaneous ( ctl . createTestsInterface ( merge ( commonOptions , {
62
- spawnOptions : {
63
- args : [ '--pass' , ' ipfs-is-awesome-software', '--offline' ]
70
+ ipfsOptions : {
71
+ pass : ' ipfs-is-awesome-software'
64
72
}
65
73
} ) ) )
66
74
67
75
tests . name ( ctl . createTestsInterface ( merge ( commonOptions , {
68
- spawnOptions : {
69
- args : [ '--pass' , 'ipfs-is-awesome-software' , '--offline' ]
76
+ ipfsOptions : {
77
+ pass : 'ipfs-is-awesome-software' ,
78
+ offline : true
70
79
}
71
80
} ) ) )
72
81
73
82
tests . namePubsub ( ctl . createTestsInterface ( merge ( commonOptions , {
74
- spawnOptions : {
75
- args : [ '--enable-namesys-pubsub' ]
83
+ ipfsOptions : {
84
+ EXPERIMENTAL : {
85
+ ipnsPubsub : true
86
+ }
76
87
}
77
88
} ) ) )
78
89
@@ -87,21 +98,13 @@ describe('interface-ipfs-core tests', function () {
87
98
88
99
tests . pin ( commonFactory )
89
100
90
- tests . ping ( commonFactory , {
91
- skip : isNode ? null : {
92
- reason : 'FIXME: ping implementation requires DHT'
93
- }
94
- } )
101
+ tests . ping ( commonFactory )
95
102
96
- tests . pubsub ( commonFactory , {
97
- skip : isNode ? null : {
98
- reason : 'FIXME: disabled because no swarm addresses'
99
- }
100
- } )
103
+ tests . pubsub ( commonFactory )
101
104
102
105
tests . repo ( commonFactory )
103
106
104
107
tests . stats ( commonFactory )
105
108
106
- tests . swarm ( commonFactory , { skip : ! isNode } )
109
+ tests . swarm ( commonFactory )
107
110
} )
0 commit comments