This repository was archived by the owner on Mar 10, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +22
-28
lines changed Expand file tree Collapse file tree 5 files changed +22
-28
lines changed Original file line number Diff line number Diff line change @@ -77,7 +77,9 @@ module.exports = (createCommon, options) => {
77
77
} )
78
78
79
79
it ( 'should copy from outside of mfs' , async ( ) => {
80
- const [ hash ] = ipfs . add ( fixtures . smallFile . data )
80
+ const [ {
81
+ hash
82
+ } ] = await ipfs . add ( fixtures . smallFile . data )
81
83
const testFilePath = `/${ hat ( ) } `
82
84
await ipfs . files . cp ( `/ipfs/${ hash } ` , testFilePath )
83
85
const testFileData = await ipfs . files . read ( testFilePath )
Original file line number Diff line number Diff line change @@ -95,10 +95,12 @@ module.exports = (createCommon, options) => {
95
95
96
96
it ( 'should ls from outside of mfs' , async ( ) => {
97
97
const testFileName = hat ( )
98
- const res = await ipfs . add ( { path : `/test/${ testFileName } ` , content : fixtures . smallFile . data } )
99
- const listing = await ipfs . files . ls ( '/ipfs/' + res [ res . length - 1 ] )
98
+ const [ {
99
+ hash
100
+ } ] = await ipfs . add ( { path : `/test/${ testFileName } ` , content : fixtures . smallFile . data } )
101
+ const listing = await ipfs . files . ls ( '/ipfs/' + hash )
100
102
expect ( listing ) . to . have . length ( 1 )
101
- expect ( listing [ 0 ] . name ) . to . equal ( testFileName )
103
+ expect ( listing [ 0 ] . name ) . to . equal ( hash )
102
104
} )
103
105
104
106
it ( 'should list an empty directory' , async ( ) => {
Original file line number Diff line number Diff line change 3
3
4
4
const series = require ( 'async/series' )
5
5
const hat = require ( 'hat' )
6
- const { fixtures } = require ( '../files-regular/utils' )
7
6
const { getDescribe, getIt, expect } = require ( '../utils/mocha' )
8
7
9
8
module . exports = ( createCommon , options ) => {
@@ -77,13 +76,5 @@ module.exports = (createCommon, options) => {
77
76
} )
78
77
} )
79
78
} )
80
-
81
- it ( 'should move from outside of mfs' , async ( ) => {
82
- const [ hash ] = ipfs . add ( fixtures . smallFile . data )
83
- const testFilePath = `/${ hat ( ) } `
84
- await ipfs . files . mv ( `/ipfs/${ hash } ` , testFilePath )
85
- const testFileData = await ipfs . files . read ( testFilePath )
86
- expect ( testFileData ) . to . eql ( fixtures . smallFile . data )
87
- } )
88
79
} )
89
80
}
Original file line number Diff line number Diff line change @@ -61,7 +61,9 @@ module.exports = (createCommon, options) => {
61
61
} )
62
62
63
63
it ( 'should read from outside of mfs' , async ( ) => {
64
- const [ hash ] = ipfs . add ( fixtures . smallFile . data )
64
+ const [ {
65
+ hash
66
+ } ] = await ipfs . add ( fixtures . smallFile . data )
65
67
const testFileData = await ipfs . files . read ( `/ipfs/${ hash } ` )
66
68
expect ( testFileData ) . to . eql ( fixtures . smallFile . data )
67
69
} )
Original file line number Diff line number Diff line change @@ -132,21 +132,18 @@ module.exports = (createCommon, options) => {
132
132
} )
133
133
} )
134
134
135
- it ( 'should stat outside of mfs' , function ( done ) {
136
- ipfs . files . stat ( '/ipfs/' + fixtures . smallFile . cid , ( err , stat ) => {
137
- expect ( err ) . to . not . exist ( )
138
- expect ( stat ) . to . include ( {
139
- type : 'file' ,
140
- blocks : 0 ,
141
- size : 12 ,
142
- hash : fixtures . smallFile . cid ,
143
- cumulativeSize : 20 ,
144
- withLocality : false
145
- } )
146
- expect ( stat . local ) . to . be . undefined ( )
147
- expect ( stat . sizeLocal ) . to . be . undefined ( )
148
- done ( )
135
+ it ( 'should stat outside of mfs' , async ( ) => {
136
+ const stat = await ipfs . files . stat ( '/ipfs/' + fixtures . smallFile . cid )
137
+ expect ( stat ) . to . include ( {
138
+ type : 'file' ,
139
+ blocks : 0 ,
140
+ size : 12 ,
141
+ hash : fixtures . smallFile . cid ,
142
+ cumulativeSize : 20 ,
143
+ withLocality : false
149
144
} )
145
+ expect ( stat . local ) . to . be . undefined ( )
146
+ expect ( stat . sizeLocal ) . to . be . undefined ( )
150
147
} )
151
148
} )
152
149
}
You can’t perform that action at this time.
0 commit comments