From 7d418a668a633b995994991b2c041db78460b7d4 Mon Sep 17 00:00:00 2001 From: Divyansh Pratap Date: Mon, 2 Sep 2024 16:38:09 +0530 Subject: [PATCH] feat: fixing uts --- test/audits/metatags.test.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/audits/metatags.test.js b/test/audits/metatags.test.js index ea4be41b..48d5f3a5 100644 --- a/test/audits/metatags.test.js +++ b/test/audits/metatags.test.js @@ -485,6 +485,7 @@ describe('Meta Tags', () => { Key: 'scrapes/site-id/blog/page1.json', }))).returns({ Body: { + transformToString: () => '', }, }); const addAuditStub = sinon.stub().resolves(); @@ -494,7 +495,7 @@ describe('Meta Tags', () => { expect(JSON.stringify(result)).to.equal(JSON.stringify(notFound('Site tags data not available'))); expect(addAuditStub.calledOnce).to.be.false; - expect(logStub.error.calledTwice).to.be.true; + expect(logStub.error.calledThrice).to.be.true; }); it('should handle gracefully if S3 tags object is not valid', async () => { @@ -524,7 +525,9 @@ describe('Meta Tags', () => { .withArgs(sinon.match.instanceOf(GetObjectCommand)) .returns({ Body: { - tags: 5, + transformToString: () => JSON.stringify({ + tags: 5, + }), }, }); const result = await auditMetaTags(message, context);