Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Controller, Get, Param, ParseIntPipe, UseGuards, UseInterceptors } from '@nestjs/common';
import { flush } from '@sentry/nestjs';
import { AppService } from './app.service';
import { ExampleGuard } from './example.guard';
import { ExampleInterceptor } from './example.interceptor';
Expand Down Expand Up @@ -68,4 +69,9 @@ export class AppController {
async killTestCron() {
this.appService.killTestCron();
}

@Get('flush')
async flush() {
await flush();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ test('Does not send HttpExceptions to Sentry', async ({ baseURL }) => {
await transactionEventPromise400;
await transactionEventPromise500;

await new Promise(resolve => setTimeout(resolve, 10000));
(await fetch(`${baseURL}/flush`)).text();

expect(errorEventOccurred).toBe(false);
});
Expand All @@ -90,7 +90,7 @@ test('Does not send RpcExceptions to Sentry', async ({ baseURL }) => {

await transactionEventPromise;

await new Promise(resolve => setTimeout(resolve, 10000));
(await fetch(`${baseURL}/flush`)).text();

expect(errorEventOccurred).toBe(false);
});
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Controller, Get, Param } from '@nestjs/common';
import { flush } from '@sentry/nestjs';
import { AppService } from './app.service';

@Controller()
Expand All @@ -14,4 +15,9 @@ export class AppController {
async testExpectedException(@Param('id') id: string) {
return this.appService.testExpectedException(id);
}

@Get('flush')
async flush() {
await flush();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ test('Does not send exception to Sentry if user-defined global exception filter

await transactionEventPromise;

await new Promise(resolve => setTimeout(resolve, 10000));
(await fetch(`${baseURL}/flush`)).text();

expect(errorEventOccurred).toBe(false);
});
Expand Down Expand Up @@ -111,7 +111,7 @@ test('Does not send exception to Sentry if user-defined local exception filter a

await transactionEventPromise;

await new Promise(resolve => setTimeout(resolve, 10000));
(await fetch(`${baseURL}/flush`)).text();

expect(errorEventOccurred).toBe(false);
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Controller, Get, Param, ParseIntPipe, UseGuards, UseInterceptors } from '@nestjs/common';
import { flush } from '@sentry/nestjs';
import { AppService } from './app.service';
import { ExampleGuard } from './example.guard';
import { ExampleInterceptor } from './example.interceptor';
Expand Down Expand Up @@ -68,4 +69,9 @@ export class AppController {
async killTestCron() {
this.appService.killTestCron();
}

@Get('flush')
async flush() {
await flush();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ test('Does not send HttpExceptions to Sentry', async ({ baseURL }) => {
await transactionEventPromise400;
await transactionEventPromise500;

await new Promise(resolve => setTimeout(resolve, 10000));
(await fetch(`${baseURL}/flush`)).text();

expect(errorEventOccurred).toBe(false);
});
Expand All @@ -90,7 +90,7 @@ test('Does not send RpcExceptions to Sentry', async ({ baseURL }) => {

await transactionEventPromise;

await new Promise(resolve => setTimeout(resolve, 10000));
(await fetch(`${baseURL}/flush`)).text();

expect(errorEventOccurred).toBe(false);
});