Skip to content

Commit

Permalink
fix the testcase
Browse files Browse the repository at this point in the history
  • Loading branch information
Rakhi Mundhada authored and Rakhi Mundhada committed Dec 21, 2023
1 parent 6c852b7 commit 674e805
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions collectors/googlestackdriver/test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
]);
});
});
Expand All @@ -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();
});
Expand Down

0 comments on commit 674e805

Please sign in to comment.