1
1
BeforeAll {
2
2
$integrationTestScript = " $PSScriptRoot $ ( [IO.Path ]::DirectorySeparatorChar) integration-test-script.ps1"
3
+ $integrationTestThrowingScript = " $PSScriptRoot $ ( [IO.Path ]::DirectorySeparatorChar) throwingshort.ps1"
3
4
$integrationTestScriptContent = Get-Content - Raw $integrationTestScript
4
5
5
6
$checkOutput = {
@@ -43,64 +44,23 @@ Describe 'Out-Sentry captures expected stack traces for command argument' -Skip:
43
44
$expected = @ (
44
45
' ----------------'
45
46
' AbsolutePath: <No file>'
46
- ' AddressMode: '
47
- ' ColumnNumber: '
48
- ' ContextLine: '
49
- ' FileName: '
50
- ' FramesOmitted: '
51
47
' Function: <ScriptBlock>'
52
- ' FunctionId: '
53
- ' ImageAddress: '
54
48
' InApp: True'
55
- ' InstructionAddress: '
56
49
' LineNumber: 1'
57
- ' Module: '
58
- ' Package: '
59
- ' Platform: '
60
- ' PostContext: '
61
- ' PreContext: '
62
- ' SymbolAddress: '
63
- ' Vars: '
64
50
' ----------------'
65
51
' AbsolutePath: <No file>'
66
- ' AddressMode: '
67
- ' ColumnNumber: '
68
- ' ContextLine: '
69
- ' FileName: '
70
- ' FramesOmitted: '
71
52
' Function: <ScriptBlock>'
72
- ' FunctionId: '
73
- ' ImageAddress: '
74
53
' InApp: True'
75
- ' InstructionAddress: '
76
- ' LineNumber: 14'
77
- ' Module: '
78
- ' Package: '
79
- ' Platform: '
80
- ' PostContext: '
81
- ' PreContext: '
82
- ' SymbolAddress: '
83
- ' Vars: '
54
+ ' LineNumber: 15'
84
55
' ----------------'
85
- ' AbsolutePath: '
86
- ' AddressMode: '
56
+ " AbsolutePath: $integrationTestThrowingScript "
87
57
' ColumnNumber: 5'
88
- " ContextLine: funcA 'throw' 'error'"
89
- ' FileName: '
90
- ' FramesOmitted: '
91
- ' Function: '
92
- ' FunctionId: '
93
- ' ImageAddress: '
58
+ ' ContextLine: throw "Short context test"'
59
+ ' Function: funcC'
94
60
' InApp: True'
95
- ' InstructionAddress: '
96
- ' LineNumber: 14'
97
- ' Module: '
98
- ' Package: '
99
- ' Platform: '
100
- ' PostContext: '
101
- ' PreContext: '
102
- ' SymbolAddress: '
103
- ' Vars: '
61
+ ' LineNumber: 2'
62
+ ' PostContext: }'
63
+ ' PreContext: function funcC {'
104
64
)
105
65
106
66
}
@@ -126,44 +86,18 @@ Describe 'Out-Sentry captures expected stack traces for piped command' {
126
86
$expected = @ (
127
87
' ----------------'
128
88
' AbsolutePath: <No file>'
129
- ' AddressMode: '
130
- ' ColumnNumber: '
131
- ' ContextLine: '
132
- ' FileName: '
133
- ' FramesOmitted: '
134
89
' Function: <ScriptBlock>'
135
- ' FunctionId: '
136
- ' ImageAddress: '
137
90
' InApp: True'
138
- ' InstructionAddress: '
139
91
' LineNumber: 3'
140
- ' Module: '
141
- ' Package: '
142
- ' Platform: '
143
- ' PostContext: '
144
- ' PreContext: '
145
- ' SymbolAddress: '
146
- ' Vars: '
147
92
' ----------------'
148
- ' AbsolutePath: '
149
- ' AddressMode: '
93
+ " AbsolutePath: $integrationTestThrowingScript "
150
94
' ColumnNumber: 5'
151
- " ContextLine: funcA 'throw' 'error'"
152
- ' FileName: '
153
- ' FramesOmitted: '
154
- ' Function: '
155
- ' FunctionId: '
156
- ' ImageAddress: '
95
+ ' ContextLine: throw "Short context test"'
96
+ ' Function: funcC'
157
97
' InApp: True'
158
- ' InstructionAddress: '
159
- ' LineNumber: 3'
160
- ' Module: '
161
- ' Package: '
162
- ' Platform: '
163
- ' PostContext: '
164
- ' PreContext: '
165
- ' SymbolAddress: '
166
- ' Vars: '
98
+ ' LineNumber: 2'
99
+ ' PostContext: }'
100
+ ' PreContext: function funcC {'
167
101
)
168
102
}
169
103
@@ -188,40 +122,15 @@ Describe 'Out-Sentry captures expected stack traces for file input' {
188
122
$expected = @ (
189
123
' ----------------'
190
124
' AbsolutePath: <No file>'
191
- ' AddressMode: '
192
- ' ColumnNumber: '
193
- ' ContextLine: '
194
- ' FileName: '
195
- ' FramesOmitted: '
196
125
' Function: <ScriptBlock>'
197
- ' FunctionId: '
198
- ' ImageAddress: '
199
126
' InApp: True'
200
- ' InstructionAddress: '
201
127
' LineNumber: 1'
202
- ' Module: '
203
- ' Package: '
204
- ' Platform: '
205
- ' PostContext: '
206
- ' PreContext: '
207
- ' SymbolAddress: '
208
- ' Vars: '
209
128
' ----------------'
210
129
" AbsolutePath: $integrationTestScript "
211
- ' AddressMode: '
212
- ' ColumnNumber: 5'
213
- " ContextLine: funcA 'throw' 'error'"
214
- ' FileName: '
215
- ' FramesOmitted: '
130
+ ' ContextLine: funcC'
216
131
' Function: <ScriptBlock>'
217
- ' FunctionId: '
218
- ' ImageAddress: '
219
132
' InApp: True'
220
- ' InstructionAddress: '
221
- ' LineNumber: 14'
222
- ' Module: '
223
- ' Package: '
224
- ' Platform: '
133
+ ' LineNumber: 15'
225
134
' PostContext: }'
226
135
' catch'
227
136
' {'
@@ -231,8 +140,15 @@ Describe 'Out-Sentry captures expected stack traces for file input' {
231
140
' StartSentryForEventTests ([ref] $events) ([ref] $transport)'
232
141
' try'
233
142
' {'
234
- ' SymbolAddress: '
235
- ' Vars: '
143
+ ' ----------------'
144
+ " AbsolutePath: $integrationTestThrowingScript "
145
+ ' ColumnNumber: 5'
146
+ ' ContextLine: throw "Short context test"'
147
+ ' Function: funcC'
148
+ ' InApp: True'
149
+ ' LineNumber: 2'
150
+ ' PostContext: }'
151
+ ' PreContext: function funcC {'
236
152
)
237
153
}
238
154
0 commit comments