Skip to content

Commit 1ce2a63

Browse files
committed
fix tests
1 parent fff16e8 commit 1ce2a63

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

packages/sveltekit/test/client/router.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ describe('sveltekitRoutingInstrumentation', () => {
2727
returnedTransaction = {
2828
...txnCtx,
2929
updateName: vi.fn(),
30+
setMetadata: vi.fn(),
3031
startChild: vi.fn().mockImplementation(ctx => {
3132
return { ...mockedRoutingSpan, ...ctx };
3233
}),

packages/tracing/test/transaction.test.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -63,18 +63,11 @@ describe('`Transaction` class', () => {
6363
});
6464

6565
describe('`updateName` method', () => {
66-
it("sets source to `'custom'` if no source provided", () => {
66+
it('does not change the source', () => {
6767
const transaction = new Transaction({ name: 'dogpark' });
68+
transaction.setMetadata({ source: 'route' });
6869
transaction.updateName('ballpit');
6970

70-
expect(transaction.name).toEqual('ballpit');
71-
expect(transaction.metadata.source).toEqual('custom');
72-
});
73-
74-
it('uses given `source` value', () => {
75-
const transaction = new Transaction({ name: 'dogpark' });
76-
transaction.updateName('ballpit', 'route');
77-
7871
expect(transaction.name).toEqual('ballpit');
7972
expect(transaction.metadata.source).toEqual('route');
8073
});

0 commit comments

Comments
 (0)