From 84d6b55e2793468710b8bfd366fef815f4a7da75 Mon Sep 17 00:00:00 2001 From: Divyansh Pratap Date: Mon, 2 Sep 2024 23:59:36 +0530 Subject: [PATCH] feat: adding info log --- src/metatags/handler.js | 1 + test/audits/metatags.test.js | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/metatags/handler.js b/src/metatags/handler.js index 33a7e634..53931789 100644 --- a/src/metatags/handler.js +++ b/src/metatags/handler.js @@ -28,6 +28,7 @@ async function fetchAndProcessPageObject(s3Client, bucketName, key, prefix, log) return null; } const pageUrl = key.slice(prefix.length - 1).replace('scrape.json', ''); // Remove the prefix and .json suffix + log.info(`Scraped tags for ${pageUrl} : ${JSON.stringify(object.scrapeResult.tags)}`); return { [pageUrl]: { title: object.scrapeResult.tags.title, diff --git a/test/audits/metatags.test.js b/test/audits/metatags.test.js index a66e924a..97ae27a3 100644 --- a/test/audits/metatags.test.js +++ b/test/audits/metatags.test.js @@ -348,7 +348,7 @@ describe('Meta Tags', () => { ], })); expect(addAuditStub.calledOnce).to.be.true; - expect(logStub.info.callCount).to.equal(4); + expect(logStub.info.callCount).to.equal(6); }); it('should process site tags and perform SEO checks for pages with invalid H1s', async () => { @@ -454,7 +454,7 @@ describe('Meta Tags', () => { ], })); expect(addAuditStub.calledOnce).to.be.true; - expect(logStub.info.callCount).to.equal(4); + expect(logStub.info.callCount).to.equal(6); }); it('should handle errors and return internalServerError', async () => {