This repository was archived by the owner on Mar 10, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +25
-5
lines changed
test/fixtures/hidden-files-folder Expand file tree Collapse file tree 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) => {
120120 } )
121121 } )
122122
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+
123143 it ( 'should add readable stream' , ( done ) => {
124144 const expectedCid = 'QmVv4Wz46JaZJeH5PMV4LGbRiiMKEmszPYY3g6fjGnVXBS'
125145
Original file line number Diff line number Diff line change @@ -25,12 +25,12 @@ function getDescribe (config) {
2525 }
2626
2727 _describe . skip = describe . skip
28- _describe . only = describe . only
28+ _describe . only = describe . only // eslint-disable-line
2929
3030 return _describe
3131 }
3232
33- if ( config . only === true ) return describe . only
33+ if ( config . only === true ) return describe . only // eslint-disable-line
3434 }
3535
3636 return describe
@@ -59,14 +59,14 @@ function getIt (config) {
5959 }
6060
6161 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
6363 }
6464
6565 it ( name , impl )
6666 }
6767
6868 _it . skip = it . skip
69- _it . only = it . only
69+ _it . only = it . only // eslint-disable-line
7070
7171 return _it
7272}
Original file line number Diff line number Diff line change 55const ipfs = require ( '../src' ) ( 'localhost' , 5001 )
66const files = process . argv . slice ( 2 )
77
8- ipfs . add ( files , { recursive : true } , function ( err , res ) {
8+ ipfs . add ( files , { recursive : true } , function ( err , res ) {
99 if ( err || ! res ) return console . log ( err )
1010
1111 for ( let i = 0 ; i < res . length ; i ++ ) {
You can’t perform that action at this time.
0 commit comments