4
4
const tests = require ( 'interface-ipfs-core' )
5
5
const isNode = require ( 'detect-node' )
6
6
const CommonFactory = require ( './utils/interface-common-factory' )
7
- const ipfsClient = require ( '../src' )
8
7
const isWindows = process . platform && process . platform === 'win32'
9
8
10
9
describe ( 'interface-ipfs-core tests' , ( ) => {
@@ -102,40 +101,11 @@ describe('interface-ipfs-core tests', () => {
102
101
103
102
tests . filesRegular ( defaultCommonFactory , {
104
103
skip : [
105
- // .add
106
- isNode ? null : {
107
- name : 'should add a nested directory as array of tupples' ,
108
- reason : 'FIXME https://github.com/ipfs/js-ipfs-http-client/issues/339'
109
- } ,
110
- isNode ? null : {
111
- name : 'should add a nested directory as array of tupples with progress' ,
112
- reason : 'FIXME https://github.com/ipfs/js-ipfs-http-client/issues/339'
113
- } ,
114
- // .addPullStream
115
- isNode ? null : {
116
- name : 'should add pull stream of valid files and dirs' ,
117
- reason : 'FIXME https://github.com/ipfs/js-ipfs-http-client/issues/339'
118
- } ,
119
- // .addReadableStream
120
- isNode ? null : {
121
- name : 'should add readable stream of valid files and dirs' ,
122
- reason : 'FIXME https://github.com/ipfs/js-ipfs-http-client/issues/339'
123
- } ,
124
104
// .addFromFs
125
105
isNode ? null : {
126
106
name : 'addFromFs' ,
127
107
reason : 'Not designed to run in the browser'
128
108
} ,
129
- // .addFromURL
130
- isNode ? null : {
131
- name : 'addFromURL' ,
132
- reason : 'Not designed to run in the browser'
133
- } ,
134
- // TODO: remove when interface-ipfs-core updated
135
- isNode ? null : {
136
- name : 'addFromUrl' ,
137
- reason : 'Not designed to run in the browser'
138
- } ,
139
109
// .catPullStream
140
110
{
141
111
name : 'should export a chunk of a file' ,
@@ -148,26 +118,6 @@ describe('interface-ipfs-core tests', () => {
148
118
{
149
119
name : 'should export a chunk of a file in a Readable Stream' ,
150
120
reason : 'TODO not implemented in go-ipfs yet'
151
- } ,
152
- // .get
153
- isNode ? null : {
154
- name : 'should get a directory' ,
155
- reason : 'FIXME https://github.com/ipfs/js-ipfs-http-client/issues/339'
156
- } ,
157
- // .ls
158
- isNode ? null : {
159
- name : 'should ls with a base58 encoded CID' ,
160
- reason : 'FIXME https://github.com/ipfs/js-ipfs-http-client/issues/339'
161
- } ,
162
- // .lsPullStream
163
- isNode ? null : {
164
- name : 'should pull stream ls with a base58 encoded CID' ,
165
- reason : 'FIXME https://github.com/ipfs/js-ipfs-http-client/issues/339'
166
- } ,
167
- // .lsReadableStream
168
- isNode ? null : {
169
- name : 'should readable stream ls with a base58 encoded CID' ,
170
- reason : 'FIXME https://github.com/ipfs/js-ipfs-http-client/issues/339'
171
121
}
172
122
]
173
123
} )
@@ -277,31 +227,5 @@ describe('interface-ipfs-core tests', () => {
277
227
278
228
tests . stats ( defaultCommonFactory )
279
229
280
- tests . swarm ( CommonFactory . create ( {
281
- createSetup ( { ipfsFactory, nodes } ) {
282
- return callback => {
283
- callback ( null , {
284
- spawnNode ( repoPath , config , cb ) {
285
- if ( typeof repoPath === 'function' ) {
286
- cb = repoPath
287
- repoPath = undefined
288
- }
289
-
290
- if ( typeof config === 'function' ) {
291
- cb = config
292
- config = undefined
293
- }
294
-
295
- const spawnOptions = { repoPath, config, initOptions : { bits : 1024 , profile : 'test' } }
296
-
297
- ipfsFactory . spawn ( spawnOptions )
298
- . then ( ipfsd => {
299
- nodes . push ( ipfsd )
300
- cb ( null , ipfsClient ( ipfsd . apiAddr ) )
301
- } , cb )
302
- }
303
- } )
304
- }
305
- }
306
- } ) )
230
+ tests . swarm ( CommonFactory . createAsync ( ) )
307
231
} )
0 commit comments