@@ -8,26 +8,74 @@ jest.mock('sentry/utils/gettingStartedDocs/python', () => {
8
8
} ;
9
9
} ) ;
10
10
11
- import { getPythonInstallSnippet } from 'sentry/utils/gettingStartedDocs/python' ;
11
+ import { getPythonInstallConfig } from 'sentry/utils/gettingStartedDocs/python' ;
12
12
13
- describe ( 'getPythonInstallSnippet ' , ( ) => {
13
+ describe ( 'getPythonInstallConfig ' , ( ) => {
14
14
it ( 'generates install commands with default parameters' , ( ) => {
15
- const result = getPythonInstallSnippet ( {
15
+ const result = getPythonInstallConfig ( {
16
16
packageName : 'sentry-sdk' ,
17
+ description : 'Install the Sentry SDK' ,
17
18
} ) ;
18
19
19
- expect ( result . pip ) . toBe ( `pip install "sentry-sdk"` ) ;
20
- expect ( result . uv ) . toBe ( `uv add "sentry-sdk"` ) ;
21
- expect ( result . poetry ) . toBe ( `poetry add "sentry-sdk"` ) ;
20
+ expect ( result ) . toEqual ( [
21
+ {
22
+ description : 'Install the Sentry SDK' ,
23
+ language : 'bash' ,
24
+ code : [
25
+ {
26
+ label : 'pip' ,
27
+ value : 'pip' ,
28
+ language : 'bash' ,
29
+ code : `pip install "sentry-sdk"` ,
30
+ } ,
31
+ {
32
+ label : 'uv' ,
33
+ value : 'uv' ,
34
+ language : 'bash' ,
35
+ code : `uv add "sentry-sdk"` ,
36
+ } ,
37
+ {
38
+ label : 'poetry' ,
39
+ value : 'poetry' ,
40
+ language : 'bash' ,
41
+ code : `poetry add "sentry-sdk"` ,
42
+ } ,
43
+ ] ,
44
+ } ,
45
+ ] ) ;
22
46
} ) ;
23
47
24
48
it ( 'generates pip install command with minimum version and extras' , ( ) => {
25
- const result = getPythonInstallSnippet ( {
49
+ const result = getPythonInstallConfig ( {
26
50
packageName : 'sentry-sdk[with-extras]' ,
51
+ description : 'Install the Sentry SDK' ,
27
52
minimumVersion : '2.3.4' ,
28
53
} ) ;
29
- expect ( result . pip ) . toBe ( `pip install --upgrade "sentry-sdk[with-extras]>=2.3.4"` ) ;
30
- expect ( result . uv ) . toBe ( `uv add --upgrade "sentry-sdk[with-extras]>=2.3.4"` ) ;
31
- expect ( result . poetry ) . toBe ( `poetry add "sentry-sdk[with-extras]>=2.3.4"` ) ;
54
+ expect ( result ) . toEqual ( [
55
+ {
56
+ description : 'Install the Sentry SDK' ,
57
+ language : 'bash' ,
58
+ code : [
59
+ {
60
+ label : 'pip' ,
61
+ value : 'pip' ,
62
+ language : 'bash' ,
63
+ code : `pip install --upgrade "sentry-sdk[with-extras]>=2.3.4"` ,
64
+ } ,
65
+ {
66
+ label : 'uv' ,
67
+ value : 'uv' ,
68
+ language : 'bash' ,
69
+ code : `uv add --upgrade "sentry-sdk[with-extras]>=2.3.4"` ,
70
+ } ,
71
+ {
72
+ label : 'poetry' ,
73
+ value : 'poetry' ,
74
+ language : 'bash' ,
75
+ code : `poetry add "sentry-sdk[with-extras]>=2.3.4"` ,
76
+ } ,
77
+ ] ,
78
+ } ,
79
+ ] ) ;
32
80
} ) ;
33
81
} ) ;
0 commit comments