@@ -23,21 +23,21 @@ export function testSet (factory: Factory<KuboNode>, options: MochaConfig): void
2323 } )
2424
2525 it ( 'should set a new key' , async ( ) => {
26- await ipfs . config . set ( 'Fruit ' , 'banana ' )
26+ await ipfs . config . set ( 'Gateway.RootRedirect ' , '/test1 ' )
2727
28- const fruit = await ipfs . config . get ( 'Fruit ' )
29- expect ( fruit ) . to . equal ( 'banana ' )
28+ const redirect = await ipfs . config . get ( 'Gateway.RootRedirect ' )
29+ expect ( redirect ) . to . equal ( '/test1 ' )
3030 } )
3131
3232 it ( 'should set an already existing key' , async ( ) => {
33- await ipfs . config . set ( 'Fruit ' , 'morango ' )
33+ await ipfs . config . set ( 'Gateway.RootRedirect ' , '/test2 ' )
3434
35- const fruit = await ipfs . config . get ( 'Fruit ' )
36- expect ( fruit ) . to . equal ( 'morango ' )
35+ const redirect = await ipfs . config . get ( 'Gateway.RootRedirect ' )
36+ expect ( redirect ) . to . equal ( '/test2 ' )
3737 } )
3838
3939 it ( 'should set a number' , async ( ) => {
40- const key = 'Discovery.MDNS.Interval '
40+ const key = 'Gateway.MaxConcurrentRequests '
4141 const val = 11
4242
4343 await ipfs . config . set ( key , val )
@@ -77,10 +77,15 @@ export function testSet (factory: Factory<KuboNode>, options: MochaConfig): void
7777 return expect ( ipfs . config . set ( uint8ArrayFromString ( 'heeey' ) , '' ) ) . to . eventually . be . rejected ( )
7878 } )
7979
80+ it ( 'should fail on unknown config key' , ( ) => {
81+ return expect ( ipfs . config . set ( 'Fruit' , 'banana' ) ) . to . eventually . be . rejected ( )
82+ . with . property ( 'message' ) . that . matches ( / F r u i t n o t f o u n d / )
83+ } )
84+
8085 it ( 'should fail on non valid value' , ( ) => {
8186 const val : any = { }
8287 val . val = val
83- return expect ( ipfs . config . set ( 'Fruit ' , val ) ) . to . eventually . be . rejected ( )
88+ return expect ( ipfs . config . set ( 'Gateway.RootRedirect ' , val ) ) . to . eventually . be . rejected ( )
8489 } )
8590 } )
8691}
0 commit comments