Skip to content

Commit

Permalink
feat: fixing uts
Browse files Browse the repository at this point in the history
  • Loading branch information
dipratap committed Sep 2, 2024
1 parent e5e448c commit 7d418a6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions test/audits/metatags.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,7 @@ describe('Meta Tags', () => {
Key: 'scrapes/site-id/blog/page1.json',
}))).returns({
Body: {
transformToString: () => '',
},
});
const addAuditStub = sinon.stub().resolves();
Expand All @@ -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 () => {
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 7d418a6

Please sign in to comment.