@@ -6,9 +6,10 @@ const { expect } = require('interface-ipfs-core/src/utils/mocha')
6
6
const hat = require ( 'hat' )
7
7
const pull = require ( 'pull-stream' )
8
8
const IPFSFactory = require ( 'ipfsd-ctl' )
9
+ const all = require ( 'it-all' )
9
10
const IPFS = require ( '../../src/core' )
10
11
11
- describe ( 'files' , function ( ) {
12
+ describe . only ( 'files' , function ( ) {
12
13
this . timeout ( 10 * 1000 )
13
14
let ipfsd , ipfs
14
15
@@ -74,24 +75,24 @@ describe('files', function () {
74
75
75
76
describe ( 'add' , ( ) => {
76
77
it ( 'should not error when passed null options' , async ( ) => {
77
- await ipfs . add ( Buffer . from ( hat ( ) ) , null )
78
+ await all ( ipfs . add ( Buffer . from ( hat ( ) ) , null ) )
78
79
} )
79
80
80
81
it ( 'should add a file with a v1 CID' , async ( ) => {
81
- const files = await ipfs . add ( Buffer . from ( [ 0 , 1 , 2 ] ) , {
82
+ const files = await all ( ipfs . add ( Buffer . from ( [ 0 , 1 , 2 ] ) , {
82
83
cidVersion : 1
83
- } )
84
+ } ) )
84
85
85
86
expect ( files . length ) . to . equal ( 1 )
86
87
expect ( files [ 0 ] . hash ) . to . equal ( 'bafkreifojmzibzlof6xyh5auu3r5vpu5l67brf3fitaf73isdlglqw2t7q' )
87
88
expect ( files [ 0 ] . size ) . to . equal ( 3 )
88
89
} )
89
90
90
91
it ( 'should add a file with a v1 CID and not raw leaves' , async ( ) => {
91
- const files = await ipfs . add ( Buffer . from ( [ 0 , 1 , 2 ] ) , {
92
+ const files = await all ( ipfs . add ( Buffer . from ( [ 0 , 1 , 2 ] ) , {
92
93
cidVersion : 1 ,
93
94
rawLeaves : false
94
- } )
95
+ } ) )
95
96
96
97
expect ( files . length ) . to . equal ( 1 )
97
98
expect ( files [ 0 ] . hash ) . to . equal ( 'bafybeide2caf5we5a7izifzwzz5ds2gla67vsfgrzvbzpnyyirnfzgwf5e' )
0 commit comments