File tree 3 files changed +25
-5
lines changed
test/fixtures/hidden-files-folder
3 files changed +25
-5
lines changed Original file line number Diff line number Diff line change @@ -120,6 +120,26 @@ module.exports = (createCommon, options) => {
120
120
} )
121
121
} )
122
122
123
+ it ( 'should not be able to add a string' , ( done ) => {
124
+ const data = `TEST${ Date . now ( ) } `
125
+
126
+ ipfs . add ( data , ( err ) => {
127
+ expect ( err ) . to . exist ( )
128
+ expect ( err . message ) . to . contain ( 'invalid input' )
129
+ done ( )
130
+ } )
131
+ } )
132
+
133
+ it ( 'should not be able to add a non-Buffer TypedArray' , ( done ) => {
134
+ const data = Uint8Array . from ( [ Date . now ( ) ] )
135
+
136
+ ipfs . add ( data , ( err ) => {
137
+ expect ( err ) . to . exist ( )
138
+ expect ( err . message ) . to . contain ( 'invalid input' )
139
+ done ( )
140
+ } )
141
+ } )
142
+
123
143
it ( 'should add readable stream' , ( done ) => {
124
144
const expectedCid = 'QmVv4Wz46JaZJeH5PMV4LGbRiiMKEmszPYY3g6fjGnVXBS'
125
145
Original file line number Diff line number Diff line change @@ -25,12 +25,12 @@ function getDescribe (config) {
25
25
}
26
26
27
27
_describe . skip = describe . skip
28
- _describe . only = describe . only
28
+ _describe . only = describe . only // eslint-disable-line
29
29
30
30
return _describe
31
31
}
32
32
33
- if ( config . only === true ) return describe . only
33
+ if ( config . only === true ) return describe . only // eslint-disable-line
34
34
}
35
35
36
36
return describe
@@ -59,14 +59,14 @@ function getIt (config) {
59
59
}
60
60
61
61
if ( Array . isArray ( config . only ) ) {
62
- if ( config . only . includes ( name ) ) return it . only ( name , impl )
62
+ if ( config . only . includes ( name ) ) return it . only ( name , impl ) // eslint-disable-line
63
63
}
64
64
65
65
it ( name , impl )
66
66
}
67
67
68
68
_it . skip = it . skip
69
- _it . only = it . only
69
+ _it . only = it . only // eslint-disable-line
70
70
71
71
return _it
72
72
}
Original file line number Diff line number Diff line change 5
5
const ipfs = require ( '../src' ) ( 'localhost' , 5001 )
6
6
const files = process . argv . slice ( 2 )
7
7
8
- ipfs . add ( files , { recursive : true } , function ( err , res ) {
8
+ ipfs . add ( files , { recursive : true } , function ( err , res ) {
9
9
if ( err || ! res ) return console . log ( err )
10
10
11
11
for ( let i = 0 ; i < res . length ; i ++ ) {
You can’t perform that action at this time.
0 commit comments