import * as Sentry from '@sentry/node'; import { startExpressServerAndSendPortToRunner } from '@sentry-internal/node-integration-tests'; import express from 'express'; const app = express(); app.get('/test/success', (_req, res) => { res.send('Success!'); }); app.get('/test/success_next', (_req, res, next) => { res.send('Success!'); next(); }); app.get('/test/success_slow', async (_req, res) => { await new Promise(res => setTimeout(res, 50)); res.send('Success!'); }); app.get('/test/error_unhandled', () => { throw new Error('Crash!'); }); app.get('/test/error_handled', (_req, res) => { try { throw new Error('Crash!'); } catch (e) { Sentry.captureException(e); } res.send('Crash!'); }); startExpressServerAndSendPortToRunner(app);