44const tests = require ( 'interface-ipfs-core' )
55const isNode = require ( 'detect-node' )
66const CommonFactory = require ( './utils/interface-common-factory' )
7- const ipfsClient = require ( '../src' )
87const isWindows = process . platform && process . platform === 'win32'
98
109describe ( 'interface-ipfs-core tests' , ( ) => {
@@ -102,40 +101,11 @@ describe('interface-ipfs-core tests', () => {
102101
103102 tests . filesRegular ( defaultCommonFactory , {
104103 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- } ,
124104 // .addFromFs
125105 isNode ? null : {
126106 name : 'addFromFs' ,
127107 reason : 'Not designed to run in the browser'
128108 } ,
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- } ,
139109 // .catPullStream
140110 {
141111 name : 'should export a chunk of a file' ,
@@ -148,26 +118,6 @@ describe('interface-ipfs-core tests', () => {
148118 {
149119 name : 'should export a chunk of a file in a Readable Stream' ,
150120 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'
171121 }
172122 ]
173123 } )
@@ -277,31 +227,5 @@ describe('interface-ipfs-core tests', () => {
277227
278228 tests . stats ( defaultCommonFactory )
279229
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 ( ) )
307231} )
0 commit comments