We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 07fe7d4 commit 5349014Copy full SHA for 5349014
src/utils.test.ts
@@ -246,6 +246,25 @@ describe('serializeError', () => {
246
});
247
248
249
+ it('handles class that has serialize function', () => {
250
+ class MockClass {
251
+ serialize() {
252
+ return { code: 1, message: 'foo' };
253
+ }
254
255
+ const error = new MockClass();
256
+ const result = serializeError(error);
257
+ expect(result).toStrictEqual({
258
+ code: 1,
259
+ message: 'foo',
260
+ });
261
+
262
+ expect(JSON.parse(JSON.stringify(result))).toStrictEqual({
263
264
265
266
267
268
it('removes non JSON-serializable props on cause', () => {
269
const error = new Error('foo');
270
// @ts-expect-error Intentionally using wrong type
0 commit comments