mirror of
				https://github.com/nttgin/BGPalerter.git
				synced 2024-05-19 06:50:08 +00:00 
			
		
		
		
	updated test for new uptime configuration
This commit is contained in:
		@@ -74,7 +74,7 @@ describe("Composition", function() {
 | 
				
			|||||||
                    "monitoredPrefixesFiles",
 | 
					                    "monitoredPrefixesFiles",
 | 
				
			||||||
                    "logging",
 | 
					                    "logging",
 | 
				
			||||||
                    "checkForUpdatesAtBoot",
 | 
					                    "checkForUpdatesAtBoot",
 | 
				
			||||||
                    "uptimeMonitor",
 | 
					                    "uptimeMonitors",
 | 
				
			||||||
                    "pidFile"
 | 
					                    "pidFile"
 | 
				
			||||||
                ]);
 | 
					                ]);
 | 
				
			||||||
            expect(config.connectors[0]).to.have
 | 
					            expect(config.connectors[0]).to.have
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -48,17 +48,19 @@ describe("Uptime Monitor", function() {
 | 
				
			|||||||
    var config = worker.config;
 | 
					    var config = worker.config;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    it("uptime config", function () {
 | 
					    it("uptime config", function () {
 | 
				
			||||||
        expect(config.uptimeMonitor).to.have
 | 
					        expect(config.uptimeMonitors[0]).to
 | 
				
			||||||
            .keys([
 | 
					            .containSubset({
 | 
				
			||||||
                "active",
 | 
					                params: {
 | 
				
			||||||
                "useStatusCodes",
 | 
					                    useStatusCodes: true,
 | 
				
			||||||
                "port"
 | 
					                    host: null,
 | 
				
			||||||
            ]);
 | 
					                    port: 8011
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					            });
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    it("API format and header", function (done) {
 | 
					    it("API format and header", function (done) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        const port = config.uptimeMonitor.port;
 | 
					        const port = config.uptimeMonitors[0].params.port;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        axios({
 | 
					        axios({
 | 
				
			||||||
            method: 'get',
 | 
					            method: 'get',
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -63,9 +63,11 @@ logging:
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
checkForUpdatesAtBoot: true
 | 
					checkForUpdatesAtBoot: true
 | 
				
			||||||
 | 
					
 | 
				
			||||||
uptimeMonitor:
 | 
					uptimeMonitors:
 | 
				
			||||||
  active: true
 | 
					  - file: uptimeApi
 | 
				
			||||||
  useStatusCodes: true
 | 
					    params:
 | 
				
			||||||
  port: 8011
 | 
					      useStatusCodes: true
 | 
				
			||||||
 | 
					      host: null
 | 
				
			||||||
 | 
					      port: 8011
 | 
				
			||||||
 | 
					
 | 
				
			||||||
pidFile: bgpalerter.pid
 | 
					pidFile: bgpalerter.pid
 | 
				
			||||||
		Reference in New Issue
	
	Block a user