Skip to content

Commit e9f9657

Browse files
committed
test: added an eslysia node app
1 parent 8adbe73 commit e9f9657

23 files changed

Lines changed: 684 additions & 38 deletions

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -961,7 +961,7 @@ jobs:
961961
with:
962962
node-version-file: 'dev-packages/e2e-tests/test-applications/${{ matrix.test-application }}/package.json'
963963
- name: Set up Bun
964-
if: contains(fromJSON('["node-exports-test-app","nextjs-16-bun", "bun-elysia"]'), matrix.test-application)
964+
if: contains(fromJSON('["node-exports-test-app","nextjs-16-bun", "elysia-bun"]'), matrix.test-application)
965965
uses: oven-sh/setup-bun@v2
966966
- name: Set up AWS SAM
967967
if: matrix.test-application == 'aws-serverless'

dev-packages/e2e-tests/test-applications/bun-elysia/.gitignore renamed to dev-packages/e2e-tests/test-applications/elysia-bun/.gitignore

File renamed without changes.

dev-packages/e2e-tests/test-applications/bun-elysia/.npmrc renamed to dev-packages/e2e-tests/test-applications/elysia-bun/.npmrc

File renamed without changes.

dev-packages/e2e-tests/test-applications/bun-elysia/package.json renamed to dev-packages/e2e-tests/test-applications/elysia-bun/package.json

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "bun-elysia-app",
2+
"name": "elysia-bun-app",
33
"version": "1.0.0",
44
"private": true,
55
"type": "module",
@@ -9,9 +9,7 @@
99
"test": "playwright test",
1010
"clean": "npx rimraf node_modules pnpm-lock.yaml",
1111
"test:build": "pnpm install",
12-
"test:build-node": "pnpm install",
13-
"test:assert": "pnpm test",
14-
"test:assert-node": "USE_NODE=true pnpm test"
12+
"test:assert": "pnpm test"
1513
},
1614
"dependencies": {
1715
"@elysiajs/opentelemetry": "^1.4.0",
@@ -25,15 +23,5 @@
2523
},
2624
"volta": {
2725
"extends": "../../package.json"
28-
},
29-
"sentryTest": {
30-
"variants": [
31-
{
32-
"build-command": "pnpm test:build-node",
33-
"assert-command": "pnpm test:assert-node",
34-
"label": "bun-elysia (node)"
35-
}
36-
],
37-
"optionalVariants": []
3826
}
3927
}

dev-packages/e2e-tests/test-applications/bun-elysia/playwright.config.mjs renamed to dev-packages/e2e-tests/test-applications/elysia-bun/playwright.config.mjs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
import { getPlaywrightConfig } from '@sentry-internal/test-utils';
22

3-
const isNode = process.env.USE_NODE === 'true';
4-
53
const config = getPlaywrightConfig({
6-
startCommand: isNode ? 'node src/app.ts' : 'bun src/app.ts',
4+
startCommand: 'bun src/app.ts',
75
});
86

97
export default config;

dev-packages/e2e-tests/test-applications/bun-elysia/src/app.ts renamed to dev-packages/e2e-tests/test-applications/elysia-bun/src/app.ts

File renamed without changes.

dev-packages/e2e-tests/test-applications/bun-elysia/start-event-proxy.mjs renamed to dev-packages/e2e-tests/test-applications/elysia-bun/start-event-proxy.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ import { startEventProxyServer } from '@sentry-internal/test-utils';
22

33
startEventProxyServer({
44
port: 3031,
5-
proxyServerName: 'bun-elysia',
5+
proxyServerName: 'elysia-bun',
66
});

dev-packages/e2e-tests/test-applications/bun-elysia/tests/errors.test.ts renamed to dev-packages/e2e-tests/test-applications/elysia-bun/tests/errors.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { expect, test } from '@playwright/test';
22
import { waitForError, waitForTransaction } from '@sentry-internal/test-utils';
33

44
test('Captures an error thrown in a route handler', async ({ baseURL, request }) => {
5-
const errorEventPromise = waitForError('bun-elysia', event => {
5+
const errorEventPromise = waitForError('elysia-bun', event => {
66
return !event.type && event.exception?.values?.[0]?.value === 'This is an exception with id 123';
77
});
88

@@ -29,7 +29,7 @@ test('Captures an error thrown in a route handler', async ({ baseURL, request })
2929
});
3030

3131
test('Error event includes request metadata', async ({ baseURL, request }) => {
32-
const errorEventPromise = waitForError('bun-elysia', event => {
32+
const errorEventPromise = waitForError('elysia-bun', event => {
3333
return !event.type && event.exception?.values?.[0]?.value === 'This is an exception with id 456';
3434
});
3535

@@ -47,7 +47,7 @@ test('Error event includes request metadata', async ({ baseURL, request }) => {
4747
});
4848

4949
test('Does not capture errors for 4xx responses', async ({ baseURL, request }) => {
50-
const transactionPromise = waitForTransaction('bun-elysia', transactionEvent => {
50+
const transactionPromise = waitForTransaction('elysia-bun', transactionEvent => {
5151
return transactionEvent?.transaction === 'GET /test-4xx';
5252
});
5353

@@ -59,7 +59,7 @@ test('Does not capture errors for 4xx responses', async ({ baseURL, request }) =
5959
});
6060

6161
test('Captures errors even when status is <= 299 in error handler', async ({ baseURL, request }) => {
62-
const errorEventPromise = waitForError('bun-elysia', event => {
62+
const errorEventPromise = waitForError('elysia-bun', event => {
6363
return !event.type && event.exception?.values?.[0]?.value === 'Error with 200 status';
6464
});
6565

@@ -75,7 +75,7 @@ test('Captures errors even when status is <= 299 in error handler', async ({ bas
7575
});
7676

7777
test('Captures POST route errors', async ({ baseURL, request }) => {
78-
const errorEventPromise = waitForError('bun-elysia', event => {
78+
const errorEventPromise = waitForError('elysia-bun', event => {
7979
return !event.type && event.exception?.values?.[0]?.value === 'Post error';
8080
});
8181

@@ -91,7 +91,7 @@ test('Captures POST route errors', async ({ baseURL, request }) => {
9191
});
9292

9393
test('Captures thrown string errors', async ({ baseURL, request }) => {
94-
const errorEventPromise = waitForError('bun-elysia', event => {
94+
const errorEventPromise = waitForError('elysia-bun', event => {
9595
return !event.type && event.exception?.values?.[0]?.value === 'String error message';
9696
});
9797

dev-packages/e2e-tests/test-applications/bun-elysia/tests/isolation.test.ts renamed to dev-packages/e2e-tests/test-applications/elysia-bun/tests/isolation.test.ts

File renamed without changes.

dev-packages/e2e-tests/test-applications/bun-elysia/tests/propagation.test.ts renamed to dev-packages/e2e-tests/test-applications/elysia-bun/tests/propagation.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ test('Includes sentry-trace and baggage in response headers', async ({ baseURL }
2121
test.fixme('Propagates trace for outgoing fetch requests', async ({ baseURL }) => {
2222
const id = randomUUID();
2323

24-
const inboundTransactionPromise = waitForTransaction('bun-elysia', transactionEvent => {
24+
const inboundTransactionPromise = waitForTransaction('elysia-bun', transactionEvent => {
2525
return (
2626
transactionEvent.contexts?.trace?.op === 'http.server' &&
2727
transactionEvent.transaction === 'GET /test-inbound-headers/:id'
2828
);
2929
});
3030

31-
const outboundTransactionPromise = waitForTransaction('bun-elysia', transactionEvent => {
31+
const outboundTransactionPromise = waitForTransaction('elysia-bun', transactionEvent => {
3232
return (
3333
transactionEvent.contexts?.trace?.op === 'http.server' &&
3434
transactionEvent.transaction === 'GET /test-outgoing-fetch/:id'
@@ -65,7 +65,7 @@ test.fixme('Propagates trace for outgoing fetch requests', async ({ baseURL }) =
6565
});
6666

6767
test.fixme('Propagates trace for outgoing fetch to external allowed URL', async ({ baseURL }) => {
68-
const inboundTransactionPromise = waitForTransaction('bun-elysia', transactionEvent => {
68+
const inboundTransactionPromise = waitForTransaction('elysia-bun', transactionEvent => {
6969
return (
7070
transactionEvent.contexts?.trace?.op === 'http.server' &&
7171
transactionEvent.transaction === 'GET /test-outgoing-fetch-external-allowed'
@@ -95,7 +95,7 @@ test.fixme('Propagates trace for outgoing fetch to external allowed URL', async
9595
});
9696

9797
test('Does not propagate outgoing fetch requests not covered by tracePropagationTargets', async ({ baseURL }) => {
98-
const inboundTransactionPromise = waitForTransaction('bun-elysia', transactionEvent => {
98+
const inboundTransactionPromise = waitForTransaction('elysia-bun', transactionEvent => {
9999
return (
100100
transactionEvent.contexts?.trace?.op === 'http.server' &&
101101
transactionEvent.transaction === 'GET /test-outgoing-fetch-external-disallowed'

0 commit comments

Comments
 (0)