File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change 1
1
import { SDK_VERSION , getDefaultIntegrations , init as browserInit } from '@sentry/browser' ;
2
2
3
+ import type { Client } from '@sentry/types' ;
3
4
import { vueIntegration } from './integration' ;
4
5
import type { Options , TracingOptions } from './types' ;
5
6
@@ -8,7 +9,7 @@ import type { Options, TracingOptions } from './types';
8
9
*/
9
10
export function init (
10
11
config : Partial < Omit < Options , 'tracingOptions' > & { tracingOptions : Partial < TracingOptions > } > = { } ,
11
- ) : void {
12
+ ) : Client | undefined {
12
13
const options = {
13
14
_metadata : {
14
15
sdk : {
@@ -26,5 +27,5 @@ export function init(
26
27
...config ,
27
28
} ;
28
29
29
- browserInit ( options ) ;
30
+ return browserInit ( options ) ;
30
31
}
Original file line number Diff line number Diff line change 1
1
import { createApp } from 'vue' ;
2
2
3
+ import type { Client } from '@sentry/types' ;
3
4
import type { Options } from '../../src/types' ;
4
5
import * as Sentry from './../../src' ;
5
6
@@ -100,12 +101,16 @@ Update your \`Sentry.init\` call with an appropriate config option:
100
101
101
102
expect ( warnings ) . toEqual ( [ ] ) ;
102
103
} ) ;
104
+
105
+ it ( 'returns client from init' , ( ) => {
106
+ expect ( runInit ( { } ) ) . not . toBeUndefined ( ) ;
107
+ } ) ;
103
108
} ) ;
104
109
105
- function runInit ( options : Partial < Options > ) : void {
110
+ function runInit ( options : Partial < Options > ) : Client | undefined {
106
111
const integration = Sentry . vueIntegration ( ) ;
107
112
108
- Sentry . init ( {
113
+ return Sentry . init ( {
109
114
dsn : PUBLIC_DSN ,
110
115
defaultIntegrations : false ,
111
116
integrations : [ integration ] ,
You can’t perform that action at this time.
0 commit comments