Skip to content

Commit 46a4917

Browse files
committed
chore: Make _wasSkipped field on integrations private
1 parent d92a7fc commit 46a4917

File tree

14 files changed

+28
-15
lines changed

14 files changed

+28
-15
lines changed

packages/node/src/integrations/http.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ export class Http implements Integration {
4141
/**
4242
* If the integration was skipped due to internal checks.
4343
*/
44-
public _wasSkipped: boolean = false;
44+
// @ts-ignore This is only used for tests
45+
private _wasSkipped: boolean = false;
4546

4647
/**
4748
* @inheritDoc

packages/node/test/integrations/http.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as sentryCore from '@sentry/core';
22
import { Hub } from '@sentry/core';
33
import { addExtensionMethods, Span, TRACEPARENT_REGEXP, Transaction } from '@sentry/tracing';
4-
import { TransactionContext } from '@sentry/types';
4+
import { Integration, TransactionContext } from '@sentry/types';
55
import { parseSemver } from '@sentry/utils';
66
import * as http from 'http';
77
import * as https from 'https';
@@ -199,7 +199,7 @@ describe('tracing', () => {
199199
});
200200
const hub = new Hub(new NodeClient(options));
201201

202-
const integration = new HttpIntegration() as HttpIntegration & { _wasSkipped: boolean };
202+
const integration = new HttpIntegration() as unknown as Integration & { _wasSkipped: boolean };
203203
integration.setupOnce(
204204
() => {},
205205
() => hub,

packages/tracing/src/integrations/node/apollo.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ export class Apollo implements Integration {
2727
/**
2828
* If the integration was skipped due to internal checks.
2929
*/
30-
public _wasSkipped: boolean = false;
30+
// @ts-ignore This is only used for tests
31+
private _wasSkipped: boolean = false;
3132

3233
/**
3334
* @inheritDoc

packages/tracing/src/integrations/node/express.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,8 @@ export class Express implements Integration {
9393
/**
9494
* If the integration was skipped due to internal checks.
9595
*/
96-
public _wasSkipped: boolean = false;
96+
// @ts-ignore This is only used for tests
97+
private _wasSkipped: boolean = false;
9798

9899
/**
99100
* Express App instance

packages/tracing/src/integrations/node/graphql.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ export class GraphQL implements Integration {
1919
/**
2020
* If the integration was skipped due to internal checks.
2121
*/
22-
public _wasSkipped: boolean = false;
22+
// @ts-ignore This is only used for tests
23+
private _wasSkipped: boolean = false;
2324

2425
/**
2526
* @inheritDoc

packages/tracing/src/integrations/node/mongo.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,8 @@ export class Mongo implements Integration {
105105
/**
106106
* If the integration was skipped due to internal checks.
107107
*/
108-
public _wasSkipped: boolean = false;
108+
// @ts-ignore This is only used for tests
109+
private _wasSkipped: boolean = false;
109110

110111
private _operations: Operation[];
111112
private _describeOperations?: boolean | Operation[];

packages/tracing/src/integrations/node/mysql.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ export class Mysql implements Integration {
2323
/**
2424
* If the integration was skipped due to internal checks.
2525
*/
26-
public _wasSkipped: boolean = false;
26+
// @ts-ignore This is only used for tests
27+
private _wasSkipped: boolean = false;
2728

2829
/**
2930
* @inheritDoc

packages/tracing/src/integrations/node/postgres.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ export class Postgres implements Integration {
2929
/**
3030
* If the integration was skipped due to internal checks.
3131
*/
32-
public _wasSkipped: boolean = false;
32+
// @ts-ignore This is only used for tests
33+
private _wasSkipped: boolean = false;
3334

3435
private _usePgNative: boolean;
3536

packages/tracing/src/integrations/node/prisma.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ export class Prisma implements Integration {
5757
/**
5858
* If the integration was skipped due to internal checks.
5959
*/
60-
public _wasSkipped: boolean = false;
60+
// @ts-ignore This is only used for tests
61+
private _wasSkipped: boolean = false;
6162

6263
/**
6364
* Prisma ORM Client Instance

packages/tracing/test/integrations/apollo.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/* eslint-disable @typescript-eslint/unbound-method */
22
import { Hub, Scope } from '@sentry/core';
3+
import { Integration } from '@sentry/types';
34

45
import { Apollo } from '../../src/integrations/node/apollo';
56
import { Span } from '../../src/span';
@@ -106,7 +107,7 @@ describe('setupOnce', () => {
106107
const client = getTestClient({ instrumenter: 'otel' });
107108
const hub = new Hub(client);
108109

109-
const integration = new Apollo() as Apollo & { _wasSkipped: boolean };
110+
const integration = new Apollo() as unknown as Integration & { _wasSkipped: boolean };
110111
integration.setupOnce(
111112
() => {},
112113
() => hub,

packages/tracing/test/integrations/graphql.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/* eslint-disable @typescript-eslint/unbound-method */
22
import { Hub, Scope } from '@sentry/core';
3+
import { Integration } from '@sentry/types';
34

45
import { GraphQL } from '../../src/integrations/node/graphql';
56
import { Span } from '../../src/span';
@@ -59,7 +60,7 @@ describe('setupOnce', () => {
5960
const client = getTestClient({ instrumenter: 'otel' });
6061
const hub = new Hub(client);
6162

62-
const integration = new GraphQL() as GraphQL & { _wasSkipped: boolean };
63+
const integration = new GraphQL() as unknown as Integration & { _wasSkipped: boolean };
6364
integration.setupOnce(
6465
() => {},
6566
() => hub,

packages/tracing/test/integrations/node/mongo.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/* eslint-disable @typescript-eslint/unbound-method */
22
import { Hub, Scope } from '@sentry/core';
3+
import { Integration } from '@sentry/types';
34

45
import { Mongo } from '../../../src/integrations/node/mongo';
56
import { Span } from '../../../src/span';
@@ -117,7 +118,7 @@ describe('patchOperation()', () => {
117118
const client = getTestClient({ instrumenter: 'otel' });
118119
const hub = new Hub(client);
119120

120-
const integration = new Mongo() as Mongo & { _wasSkipped: boolean };
121+
const integration = new Mongo() as unknown as Integration & { _wasSkipped: boolean };
121122
integration.setupOnce(
122123
() => {},
123124
() => hub,

packages/tracing/test/integrations/node/postgres.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/* eslint-disable @typescript-eslint/unbound-method */
22
import { Hub, Scope } from '@sentry/core';
3+
import { Integration } from '@sentry/types';
34

45
import { Postgres } from '../../../src/integrations/node/postgres';
56
import { Span } from '../../../src/span';
@@ -100,7 +101,7 @@ describe('setupOnce', () => {
100101
const client = getTestClient({ instrumenter: 'otel' });
101102
const hub = new Hub(client);
102103

103-
const integration = new Postgres() as Postgres & { _wasSkipped: boolean };
104+
const integration = new Postgres() as unknown as Integration & { _wasSkipped: boolean };
104105
integration.setupOnce(
105106
() => {},
106107
() => hub,

packages/tracing/test/integrations/node/prisma.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/* eslint-disable @typescript-eslint/unbound-method */
22
import { Hub, Scope } from '@sentry/core';
3+
import { Integration } from '@sentry/types';
34

45
import { Prisma } from '../../../src/integrations/node/prisma';
56
import { Span } from '../../../src/span';
@@ -64,7 +65,7 @@ describe('setupOnce', function () {
6465
const client = getTestClient({ instrumenter: 'otel' });
6566
const hub = new Hub(client);
6667

67-
const integration = new Prisma() as Prisma & { _wasSkipped: boolean };
68+
const integration = new Prisma() as unknown as Integration & { _wasSkipped: boolean };
6869
integration.setupOnce(
6970
() => {},
7071
() => hub,

0 commit comments

Comments
 (0)