From c42ff47930a7b6c19e6c3f1ae96efc486d37e6ce Mon Sep 17 00:00:00 2001 From: Geof Holbrook Date: Fri, 27 Oct 2023 13:48:07 -0400 Subject: [PATCH] [gravel-gateway-compat] create new instance of gateway for test --- test/pushgatewayTest.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/test/pushgatewayTest.js b/test/pushgatewayTest.js index 2171d861..f7a510e9 100644 --- a/test/pushgatewayTest.js +++ b/test/pushgatewayTest.js @@ -102,12 +102,16 @@ describe.each([ .post('/metrics', body) .reply(200); - instance.requireJobName = false; + instance = new Pushgateway( + 'http://192.168.99.100:9091', + { + timeout: 10, + requireJobName: false, + }, + registry, + ); - return instance.pushAdd().then(() => { - instance.requireJobName = true; - return expect(mockHttp.isDone()); - }); + return instance.pushAdd().then(() => expect(mockHttp.isDone())); }); });