Skip to content

Commit 8d3862b

Browse files
committed
test cleanup
1 parent 7dd2a0f commit 8d3862b

File tree

4 files changed

+18
-33
lines changed

4 files changed

+18
-33
lines changed

packages/browser/test/unit/backend.test.ts

Lines changed: 0 additions & 12 deletions
This file was deleted.

packages/browser/test/unit/index.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ describe('SentryBrowser initialization', () => {
246246
it('should set SDK data when Sentry.init() is called', () => {
247247
init({ dsn });
248248

249-
const sdkData = (getCurrentHub().getClient() as any)._backend._transport._api.metadata?.sdk;
249+
const sdkData = (getCurrentHub().getClient() as any)._transport._api.metadata?.sdk;
250250

251251
expect(sdkData.name).toBe('sentry.javascript.browser');
252252
expect(sdkData.packages[0].name).toBe('npm:@sentry/browser');
@@ -257,7 +257,7 @@ describe('SentryBrowser initialization', () => {
257257
it('should set SDK data when instantiating a client directly', () => {
258258
const client = new BrowserClient({ dsn });
259259

260-
const sdkData = (client as any)._backend._transport._api.metadata?.sdk;
260+
const sdkData = (client as any)._transport._api.metadata?.sdk;
261261

262262
expect(sdkData.name).toBe('sentry.javascript.browser');
263263
expect(sdkData.packages[0].name).toBe('npm:@sentry/browser');
@@ -285,7 +285,7 @@ describe('SentryBrowser initialization', () => {
285285
},
286286
});
287287

288-
const sdkData = (getCurrentHub().getClient() as any)._backend._transport._api.metadata?.sdk;
288+
const sdkData = (getCurrentHub().getClient() as any)._transport._api.metadata?.sdk;
289289

290290
expect(sdkData.name).toBe('sentry.javascript.angular');
291291
expect(sdkData.packages[0].name).toBe('npm:@sentry/angular');

packages/browser/test/unit/integrations/linkederrors.test.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { ExtendedError } from '@sentry/types';
22

3-
import { BrowserBackend } from '../../../src/backend';
3+
import { BrowserClient } from '../../../src/client';
44
import * as LinkedErrorsModule from '../../../src/integrations/linkederrors';
55

66
describe('LinkedErrors', () => {
@@ -34,8 +34,8 @@ describe('LinkedErrors', () => {
3434
one.cause = two;
3535

3636
const originalException = one;
37-
const backend = new BrowserBackend({});
38-
return backend.eventFromException(originalException).then(event => {
37+
const client = new BrowserClient({});
38+
return client.eventFromException(originalException).then(event => {
3939
const result = LinkedErrorsModule._handler('cause', 5, event, {
4040
originalException,
4141
});
@@ -64,8 +64,8 @@ describe('LinkedErrors', () => {
6464
one.reason = two;
6565

6666
const originalException = one;
67-
const backend = new BrowserBackend({});
68-
return backend.eventFromException(originalException).then(event => {
67+
const client = new BrowserClient({});
68+
return client.eventFromException(originalException).then(event => {
6969
const result = LinkedErrorsModule._handler('reason', 5, event, {
7070
originalException,
7171
});
@@ -90,9 +90,9 @@ describe('LinkedErrors', () => {
9090
one.cause = two;
9191
two.cause = three;
9292

93-
const backend = new BrowserBackend({});
93+
const client = new BrowserClient({});
9494
const originalException = one;
95-
return backend.eventFromException(originalException).then(event => {
95+
return client.eventFromException(originalException).then(event => {
9696
const result = LinkedErrorsModule._handler('cause', 2, event, {
9797
originalException,
9898
});

packages/core/src/baseclient.ts

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,30 +35,28 @@ const ALREADY_SEEN_ERROR = "Not capturing exception because it's already been ca
3535
/**
3636
* Base implementation for all JavaScript SDK clients.
3737
*
38-
* Call the constructor with the corresponding backend constructor and options
39-
* specific to the client subclass. To access these options later, use
40-
* {@link Client.getOptions}. Also, the Backend instance is available via
41-
* {@link Client.getBackend}.
38+
* Call the constructor with the options specific to the client subclass.
39+
* To access these options later, use {@link Client.getOptions}.
4240
*
4341
* If a Dsn is specified in the options, it will be parsed and stored. Use
4442
* {@link Client.getDsn} to retrieve the Dsn at any moment. In case the Dsn is
4543
* invalid, the constructor will throw a {@link SentryException}. Note that
4644
* without a valid Dsn, the SDK will not send any events to Sentry.
4745
*
48-
* Before sending an event via the backend, it is passed through
49-
* {@link BaseClient._prepareEvent} to add SDK information and scope data
50-
* (breadcrumbs and context). To add more custom information, override this
51-
* method and extend the resulting prepared event.
46+
* Before sending an event, it is passed through {@link BaseClient._prepareEvent}
47+
* to add SDK information and scope data (breadcrumbs and context).
48+
* To add more custom information, override this method and extend the
49+
* resulting prepared event.
5250
*
5351
* To issue automatically created events (e.g. via instrumentation), use
5452
* {@link Client.captureEvent}. It will prepare the event and pass it through
5553
* the callback lifecycle. To issue auto-breadcrumbs, use
5654
* {@link Client.addBreadcrumb}.
5755
*
5856
* @example
59-
* class NodeClient extends BaseClient<NodeBackend, NodeOptions> {
57+
* class NodeClient extends BaseClient<NodeOptions> {
6058
* public constructor(options: NodeOptions) {
61-
* super(NodeBackend, options);
59+
* super(options);
6260
* }
6361
*
6462
* // ...
@@ -83,7 +81,6 @@ export abstract class BaseClient<O extends Options> implements Client<O> {
8381
/**
8482
* Initializes this client instance.
8583
*
86-
* @param backendClass A constructor function to create the backend.
8784
* @param options Options for the client.
8885
*/
8986
protected constructor(options: O) {

0 commit comments

Comments
 (0)