@@ -16,7 +16,7 @@ export type TestServerConfig = {
16
16
17
17
export type DataCollectorOptions = {
18
18
// The expected amount of requests to the envelope endpoint.
19
- // If the amount of sentrequests is lower than`count`, this function will not resolve.
19
+ // If the amount of sent requests is lower than `count`, this function will not resolve.
20
20
count ?: number ;
21
21
22
22
// The method of the request.
@@ -90,7 +90,7 @@ export const parseEnvelope = (body: string): Array<Record<string, unknown>> => {
90
90
/**
91
91
* Intercepts and extracts up to a number of requests containing Sentry envelopes.
92
92
*
93
- * @param {TestServerConfig } config The url, server instance and the nock scope .
93
+ * @param {TestServerConfig } config The url and the server instance .
94
94
* @param {DataCollectorOptions } options
95
95
* @returns The intercepted envelopes.
96
96
*/
@@ -174,9 +174,10 @@ const makeRequest = async (method: 'get' | 'post', url: string): Promise<void> =
174
174
} ;
175
175
176
176
/**
177
- * Sends a get request to given URL, with optional headers
177
+ * Sends a get request to given URL, with optional headers. Returns the response.
178
+ * Ends the server instance and flushes the Sentry event queue.
178
179
*
179
- * @param {TestServerConfig } config The url, server instance and the nock scope .
180
+ * @param {TestServerConfig } config The url and the server instance .
180
181
* @param {Record<string, string> } [headers]
181
182
* @return {* } {Promise<any>}
182
183
*/
@@ -192,7 +193,7 @@ export const getAPIResponse = async (config: TestServerConfig, headers?: Record<
192
193
/**
193
194
* Intercepts and extracts a single request containing a Sentry envelope
194
195
*
195
- * @param {TestServerConfig } config The url, server instance and the nock scope .
196
+ * @param {TestServerConfig } config The url and the server instance .
196
197
* @param {DataCollectorOptions } options
197
198
* @returns The extracted envelope.
198
199
*/
@@ -240,6 +241,13 @@ export async function runServer(
240
241
return { url, server } ;
241
242
}
242
243
244
+ /**
245
+ * Sends a get request to given URL.
246
+ * Flushes the Sentry event queue.
247
+ *
248
+ * @param {string } url
249
+ * @return {* } {Promise<void>}
250
+ */
243
251
export async function runScenario ( url : string ) : Promise < void > {
244
252
await axios . get ( url ) ;
245
253
await Sentry . flush ( ) ;
0 commit comments