From ec4decd7ef474730d6ce35a6594ff33c2852f343 Mon Sep 17 00:00:00 2001 From: Francesco Novy Date: Wed, 3 Jan 2024 11:15:12 +0100 Subject: [PATCH] fix tests --- packages/sveltekit/test/client/router.test.ts | 1 + packages/tracing/test/transaction.test.ts | 11 ++--------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/packages/sveltekit/test/client/router.test.ts b/packages/sveltekit/test/client/router.test.ts index 3b8fe3059777..648e5344e6c8 100644 --- a/packages/sveltekit/test/client/router.test.ts +++ b/packages/sveltekit/test/client/router.test.ts @@ -27,6 +27,7 @@ describe('sveltekitRoutingInstrumentation', () => { returnedTransaction = { ...txnCtx, updateName: vi.fn(), + setMetadata: vi.fn(), startChild: vi.fn().mockImplementation(ctx => { return { ...mockedRoutingSpan, ...ctx }; }), diff --git a/packages/tracing/test/transaction.test.ts b/packages/tracing/test/transaction.test.ts index dafb6cb63714..12c6c799883a 100644 --- a/packages/tracing/test/transaction.test.ts +++ b/packages/tracing/test/transaction.test.ts @@ -63,18 +63,11 @@ describe('`Transaction` class', () => { }); describe('`updateName` method', () => { - it("sets source to `'custom'` if no source provided", () => { + it('does not change the source', () => { const transaction = new Transaction({ name: 'dogpark' }); + transaction.setMetadata({ source: 'route' }); transaction.updateName('ballpit'); - expect(transaction.name).toEqual('ballpit'); - expect(transaction.metadata.source).toEqual('custom'); - }); - - it('uses given `source` value', () => { - const transaction = new Transaction({ name: 'dogpark' }); - transaction.updateName('ballpit', 'route'); - expect(transaction.name).toEqual('ballpit'); expect(transaction.metadata.source).toEqual('route'); });