Skip to content

Commit 4de37b9

Browse files
committed
100% coverage <3
1 parent 697c099 commit 4de37b9

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

packages/core/test/lib/attributes.test.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,21 @@ describe('attributeValueToTypedAttributeValue', () => {
245245
});
246246
});
247247

248+
it('returns empty string if JSON.stringify fails', () => {
249+
const result = attributeValueToTypedAttributeValue(
250+
{
251+
toJSON: () => {
252+
throw new Error('test');
253+
},
254+
},
255+
true,
256+
);
257+
expect(result).toStrictEqual({
258+
value: '',
259+
type: 'string',
260+
});
261+
});
262+
248263
it('stringifies non-primitive attribute object values', () => {
249264
const result = attributeValueToTypedAttributeValue({ value: { nested: 'object' } }, true);
250265
expect(result).toStrictEqual({

0 commit comments

Comments
 (0)