Skip to content

Commit

Permalink
Fix nextjs tests
Browse files Browse the repository at this point in the history
  • Loading branch information
timfish committed Nov 11, 2022
1 parent 4f04434 commit 3f3c08e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/nextjs/src/index.server.ts
Expand Up @@ -129,7 +129,7 @@ function addServerIntegrations(options: NextjsOptions): void {
if (hasTracingEnabled(options)) {
const defaultHttpTracingIntegration = new Integrations.Http({ tracing: true });
integrations = addOrUpdateIntegration(defaultHttpTracingIntegration, integrations, {
_tracing: true,
_tracing: {},
});
}

Expand Down
8 changes: 4 additions & 4 deletions packages/nextjs/test/index.server.test.ts
Expand Up @@ -169,7 +169,7 @@ describe('Server init()', () => {
const httpIntegration = findIntegrationByName(nodeInitOptions.integrations, 'Http');

expect(httpIntegration).toBeDefined();
expect(httpIntegration).toEqual(expect.objectContaining({ _tracing: true }));
expect(httpIntegration).toEqual(expect.objectContaining({ _tracing: {} }));
});

it('adds `Http` integration with tracing enabled if `tracesSampler` is set', () => {
Expand All @@ -179,7 +179,7 @@ describe('Server init()', () => {
const httpIntegration = findIntegrationByName(nodeInitOptions.integrations, 'Http');

expect(httpIntegration).toBeDefined();
expect(httpIntegration).toEqual(expect.objectContaining({ _tracing: true }));
expect(httpIntegration).toEqual(expect.objectContaining({ _tracing: {} }));
});

it('does not add `Http` integration if tracing not enabled in SDK', () => {
Expand All @@ -201,7 +201,7 @@ describe('Server init()', () => {
const httpIntegration = findIntegrationByName(nodeInitOptions.integrations, 'Http');

expect(httpIntegration).toBeDefined();
expect(httpIntegration).toEqual(expect.objectContaining({ _tracing: true }));
expect(httpIntegration).toEqual(expect.objectContaining({ _tracing: {} }));
});

it('forces `_tracing = true` if `tracesSampler` is set', () => {
Expand All @@ -214,7 +214,7 @@ describe('Server init()', () => {
const httpIntegration = findIntegrationByName(nodeInitOptions.integrations, 'Http');

expect(httpIntegration).toBeDefined();
expect(httpIntegration).toEqual(expect.objectContaining({ _tracing: true }));
expect(httpIntegration).toEqual(expect.objectContaining({ _tracing: {} }));
});

it('does not force `_tracing = true` if tracing not enabled in SDK', () => {
Expand Down

0 comments on commit 3f3c08e

Please sign in to comment.