Skip to content

feat(core): Introduce seperate client options #4927

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 33 commits into from
Apr 19, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
2c06ccc
feat(core): Introduce seperate client options
AbhiPrasad Apr 12, 2022
3ad3988
add client options to baseclient
AbhiPrasad Apr 14, 2022
945b10a
updates types
AbhiPrasad Apr 14, 2022
d0d03c9
introduce diff option types
AbhiPrasad Apr 14, 2022
23d16a0
introduce diff browser types:
AbhiPrasad Apr 14, 2022
9167493
node client options
AbhiPrasad Apr 14, 2022
61a26dd
switch browser
AbhiPrasad Apr 14, 2022
b411f02
don't do anything with the dsn
AbhiPrasad Apr 14, 2022
f6d09ab
dsn type fix
AbhiPrasad Apr 14, 2022
698a8f7
fix export
AbhiPrasad Apr 14, 2022
0256a7b
make dsn
AbhiPrasad Apr 14, 2022
e8335f2
missing import
AbhiPrasad Apr 14, 2022
5b4eec9
remove default core options
AbhiPrasad Apr 18, 2022
69d7f6a
add comments
AbhiPrasad Apr 18, 2022
f3bce9e
cast option types
AbhiPrasad Apr 18, 2022
4e9fb6b
explicit types
AbhiPrasad Apr 18, 2022
77b4a21
fix import
AbhiPrasad Apr 18, 2022
bd62e26
fix tests
AbhiPrasad Apr 19, 2022
e26e615
fix transport types
AbhiPrasad Apr 19, 2022
e3d1681
yarn fix
AbhiPrasad Apr 19, 2022
5bbcc5c
round 1 of fixing tests
AbhiPrasad Apr 19, 2022
50e9363
rename `TestOptions -> TestClientOptions`
Lms24 Apr 19, 2022
94df681
tmp fix core `sdk.test.ts`
Lms24 Apr 19, 2022
68165d5
Add tests for integration setup in node init
lforst Apr 19, 2022
9371d48
Further fix node tests
lforst Apr 19, 2022
ba61707
add tests for integration setup in browser init
Lms24 Apr 19, 2022
957452f
Fix some eslint errors in node tests
lforst Apr 19, 2022
0e142ab
Extract `getDefaultNodeClientOptions` into helper module
lforst Apr 19, 2022
bb8f917
fix remaning browser unit tests
Lms24 Apr 19, 2022
fed3fd0
fix tracing unit tests
Lms24 Apr 19, 2022
88d4cff
fix linter errors
Lms24 Apr 19, 2022
ea99698
fix another set of linter errors
Lms24 Apr 19, 2022
3d098ff
fix lint in browser sdk unit test
AbhiPrasad Apr 19, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion packages/tracing/test/browser/backgroundtab.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { BrowserClient } from '@sentry/browser';
import { setupBrowserTransport } from '@sentry/browser/src/transports';
import { getDefaultBrowserClientOptions } from '@sentry/browser/test/unit/helper/browser-client-options';
import { Hub, makeMain } from '@sentry/hub';
import { JSDOM } from 'jsdom';

Expand All @@ -14,7 +15,7 @@ describe('registerBackgroundTabDetection', () => {
// @ts-ignore need to override global document
global.document = dom.window.document;

const options = { tracesSampleRate: 1 };
const options = getDefaultBrowserClientOptions({ tracesSampleRate: 1 });
hub = new Hub(new BrowserClient(options, setupBrowserTransport(options).transport));
makeMain(hub);

Expand Down
7 changes: 4 additions & 3 deletions packages/tracing/test/browser/browsertracing.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { BrowserClient } from '@sentry/browser';
import { setupBrowserTransport } from '@sentry/browser/src/transports';
import { getDefaultBrowserClientOptions } from '@sentry/browser/test/unit/helper/browser-client-options';
import { Hub, makeMain } from '@sentry/hub';
import { getGlobalObject, InstrumentHandlerCallback, InstrumentHandlerType } from '@sentry/utils';
import { JSDOM } from 'jsdom';
Expand Down Expand Up @@ -52,7 +53,7 @@ describe('BrowserTracing', () => {
let hub: Hub;
beforeEach(() => {
jest.useFakeTimers();
const options = { tracesSampleRate: 1 };
const options = getDefaultBrowserClientOptions({ tracesSampleRate: 1 });
hub = new Hub(new BrowserClient(options, setupBrowserTransport(options).transport));
makeMain(hub);
document.head.innerHTML = '';
Expand Down Expand Up @@ -474,7 +475,7 @@ describe('BrowserTracing', () => {
getGlobalObject<Window>().location = dogParkLocation as any;

const tracesSampler = jest.fn();
const options = { tracesSampler };
const options = getDefaultBrowserClientOptions({ tracesSampler });
hub.bindClient(new BrowserClient(options, setupBrowserTransport(options).transport));
// setting up the BrowserTracing integration automatically starts a pageload transaction
createBrowserTracing(true);
Expand All @@ -491,7 +492,7 @@ describe('BrowserTracing', () => {
getGlobalObject<Window>().location = dogParkLocation as any;

const tracesSampler = jest.fn();
const options = { tracesSampler };
const options = getDefaultBrowserClientOptions({ tracesSampler });
hub.bindClient(new BrowserClient(options, setupBrowserTransport(options).transport));
// setting up the BrowserTracing integration normally automatically starts a pageload transaction, but that's not
// what we're testing here
Expand Down
3 changes: 2 additions & 1 deletion packages/tracing/test/browser/request.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { BrowserClient } from '@sentry/browser';
import { setupBrowserTransport } from '@sentry/browser/src/transports';
import { getDefaultBrowserClientOptions } from '@sentry/browser/test/unit/helper/browser-client-options';
import { Hub, makeMain } from '@sentry/hub';
import * as utils from '@sentry/utils';

Expand Down Expand Up @@ -73,7 +74,7 @@ describe('callbacks', () => {
};

beforeAll(() => {
const options = { tracesSampleRate: 1 };
const options = getDefaultBrowserClientOptions({ tracesSampleRate: 1 });
hub = new Hub(new BrowserClient(options, setupBrowserTransport(options).transport));
makeMain(hub);
});
Expand Down
Loading