Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mydea committed Jan 3, 2024
1 parent 2ac913c commit ec4decd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
1 change: 1 addition & 0 deletions packages/sveltekit/test/client/router.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ describe('sveltekitRoutingInstrumentation', () => {
returnedTransaction = {
...txnCtx,
updateName: vi.fn(),
setMetadata: vi.fn(),
startChild: vi.fn().mockImplementation(ctx => {
return { ...mockedRoutingSpan, ...ctx };
}),
Expand Down
11 changes: 2 additions & 9 deletions packages/tracing/test/transaction.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
});
Expand Down

0 comments on commit ec4decd

Please sign in to comment.