Skip to content

Commit ccb229d

Browse files
MikhusCopilot
andauthored
Update test/profile.more.branches.spec.ts
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 3ab462e commit ccb229d

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

test/profile.more.branches.spec.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,13 @@ describe('profile.ts additional branches', () => {
4040
const fakeLogger: any = {
4141
error: sinon.spy(),
4242
};
43-
const args = [BigInt(1)]; // JSON.stringify throws on BigInt
43+
it('logDebugInfo: should call logger.error on JSON.stringify error (explicit stub)', () => {
44+
const { logDebugInfo, LogLevel } = mock.reRequire('../src/profile');
45+
const fakeLogger: any = {
46+
error: sinon.spy(),
47+
};
48+
const args = [{ foo: 'bar' }];
49+
const jsonStringifyStub = sinon.stub(JSON, 'stringify').throws(new Error('Serialization failed'));
4450
const options = {
4551
debugTime: false,
4652
debugArgs: true,

0 commit comments

Comments
 (0)