Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions tests/unit/loggingDatabaseOperations.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,14 @@ describe('LoggingDatabaseOperations', () => {
assert.ok(mockChannel.lines[0].includes('params: [[Object]]'));
});

it('should fallback to [Object] when JSON.stringify throws', async () => {
const thrower = {
toJSON() { throw new Error('Stringify error'); }
};
await logger.executeQuery('SELECT *', [thrower as any]);
assert.ok(mockChannel.lines[0].includes('params: [[Object]]'));
});

it('should pass through numbers', async () => {
await logger.executeQuery('SELECT *', [123.45]);
assert.ok(mockChannel.lines[0].includes('params: [123.45]'));
Expand Down