@@ -55,7 +55,7 @@ describe('RabbitMQ plugin settings', () => {
5555 process . argv = oldArgs ;
5656 } ) ;
5757
58- it ( 'should return the settings if everything is correct' , ( ) => {
58+ it ( 'should return the settings if everything is correct with queue configuration ' , ( ) => {
5959 const oldArgs = process . argv ;
6060 process . argv = [
6161 'node' , // not used but a value is required at this index
@@ -88,6 +88,24 @@ describe('RabbitMQ plugin settings', () => {
8888 } ) ;
8989 process . argv = oldArgs ;
9090 } ) ;
91+
92+ it ( 'should return the settings if everything is correct with exchange and a blank routing key' , ( ) => {
93+ const oldArgs = process . argv ;
94+ process . argv = [
95+ 'node' , // not used but a value is required at this index
96+ 'a_script_file.js' , // not used but a value is required at this index
97+ '--plugin_rabbitmq_url' , 'test-url' ,
98+ '--plugin_rabbitmq_exchange' , 'test-exchange' ,
99+ '--plugin_rabbitmq_routing_key' , '' ,
100+ ] ;
101+ const settings = getSettings ( ) ;
102+ expect ( settings ) . toMatchObject ( {
103+ url : 'test-url' ,
104+ exchange : 'test-exchange' ,
105+ routingKey : '' ,
106+ } ) ;
107+ process . argv = oldArgs ;
108+ } ) ;
91109} ) ;
92110
93111describe ( 'RabbitMQ plugin event handler' , ( ) => {
0 commit comments