From 674e8057bd9ce8fedbd977f43a515a1aba2abe80 Mon Sep 17 00:00:00 2001 From: Rakhi Mundhada Date: Thu, 21 Dec 2023 15:53:05 +0530 Subject: [PATCH] fix the testcase --- collectors/googlestackdriver/test/test.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/collectors/googlestackdriver/test/test.js b/collectors/googlestackdriver/test/test.js index 727f191d..73b4e8af 100644 --- a/collectors/googlestackdriver/test/test.js +++ b/collectors/googlestackdriver/test/test.js @@ -235,13 +235,14 @@ describe('Unit Tests', function() { it('Stops paginiating at the pagination limit', function(done) { logginClientStub = sinon.stub(logging.v2.LoggingServiceV2Client.prototype, 'listLogEntries'); + const nextPage = { pageToken: 'http://somenextpage.com', "pageSize": 1000, "resourceNames": ["projects/a-fake-project"] }; logginClientStub.callsFake(() => { return new Promise((res, rej) => { res([ [ googlestackdriverMock.LOG_EVENT_PROTO_PAYLOAD ], - 'http://somenextpage.com' + nextPage ]); }); }); @@ -258,7 +259,7 @@ describe('Unit Tests', function() { collector.pawsGetLogs(curState, (err, logs, newState, newPollInterval) =>{ assert.ok(logginClientStub.calledTwice); assert.equal(logs.length, parseInt(process.env.paws_max_pages_per_invocation)); - assert.equal(newState.nextPage, 'http://somenextpage.com'); + assert.deepEqual(newState.nextPage, nextPage); restoreLoggingClientStub(); done(); });