Skip to content

Commit ee63243

Browse files
committed
Merge init and subject into scenario, add a default server.
1 parent d53e4c6 commit ee63243

File tree

7 files changed

+9
-15
lines changed

7 files changed

+9
-15
lines changed

packages/node-integration-tests/suites/send-event/capture-exception/init.ts renamed to packages/node-integration-tests/suites/send-event/capture-exception/scenario.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@ Sentry.init({
44
dsn: 'https://[email protected]/1337',
55
release: '1.0',
66
});
7+
8+
Sentry.captureException('Error');

packages/node-integration-tests/suites/send-event/capture-exception/subject.ts

Lines changed: 0 additions & 3 deletions
This file was deleted.

packages/node-integration-tests/suites/send-event/capture-message/init.ts renamed to packages/node-integration-tests/suites/send-event/capture-message/scenario.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@ Sentry.init({
44
dsn: 'https://[email protected]/1337',
55
release: '1.0',
66
});
7+
8+
Sentry.captureMessage('Message');

packages/node-integration-tests/suites/send-event/capture-message/server.ts

Lines changed: 0 additions & 5 deletions
This file was deleted.

packages/node-integration-tests/suites/send-event/capture-message/subject.ts

Lines changed: 0 additions & 3 deletions
This file was deleted.

packages/node-integration-tests/utils/index.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import { Express } from 'express';
44
import * as http from 'http';
55
import nock from 'nock';
6+
import * as path from 'path';
67
import { getPortPromise } from 'portfinder';
78

89
const keysToReplace = {
@@ -69,17 +70,17 @@ const getEnvelopeRequest = async (url: string): Promise<Record<string, any>> =>
6970
});
7071
};
7172

72-
async function runServer(testDir: string): Promise<string> {
73+
async function runServer(testDir: string, serverPath?: string, scenarioPath?: string): Promise<string> {
7374
const port = await getPortPromise();
7475
const url = `http://localhost:${port}/test`;
76+
const defaultServerPath = path.resolve(process.cwd(), 'utils', 'defaults', 'server');
7577

7678
await new Promise(resolve => {
7779
// eslint-disable-next-line @typescript-eslint/no-var-requires
78-
const app = require(`${testDir}/server`).default as Express;
80+
const app = require(serverPath || defaultServerPath).default as Express;
7981

8082
app.get('/test', async () => {
81-
require(`${testDir}/init`);
82-
require(`${testDir}/subject`);
83+
require(scenarioPath || `${testDir}/scenario`);
8384

8485
setTimeout(() => server.close(), 500);
8586
});

0 commit comments

Comments
 (0)