Skip to content

Commit 3e658e3

Browse files
committed
chore: update tests and added node variant
1 parent 2bae677 commit 3e658e3

4 files changed

Lines changed: 23 additions & 7 deletions

File tree

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

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,16 @@
22
"name": "bun-elysia-app",
33
"version": "1.0.0",
44
"private": true,
5+
"type": "module",
56
"scripts": {
67
"start": "bun src/app.ts",
8+
"start:node": "node src/app.ts",
79
"test": "playwright test",
810
"clean": "npx rimraf node_modules pnpm-lock.yaml",
911
"test:build": "pnpm install",
10-
"test:assert": "pnpm test"
12+
"test:build-node": "pnpm install",
13+
"test:assert": "pnpm test",
14+
"test:assert-node": "USE_NODE=true pnpm test"
1115
},
1216
"dependencies": {
1317
"@elysiajs/opentelemetry": "^1.4.0",
@@ -21,5 +25,15 @@
2125
},
2226
"volta": {
2327
"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": []
2438
}
2539
}
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import { getPlaywrightConfig } from '@sentry-internal/test-utils';
22

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

79
export default config;

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ test('Captures an error thrown in a route handler', async ({ baseURL, request })
1414
const exception = errorEvent.exception?.values?.[0];
1515
expect(exception?.value).toBe('This is an exception with id 123');
1616
expect(exception?.mechanism).toEqual({
17-
type: 'elysia',
17+
type: 'auto.http.elysia.on_error',
1818
handled: false,
1919
});
2020

@@ -69,7 +69,7 @@ test('Captures errors even when status is <= 299 in error handler', async ({ bas
6969

7070
expect(errorEvent.exception?.values?.[0]?.value).toBe('Error with 200 status');
7171
expect(errorEvent.exception?.values?.[0]?.mechanism).toEqual({
72-
type: 'elysia',
72+
type: 'auto.http.elysia.on_error',
7373
handled: false,
7474
});
7575
});
@@ -85,7 +85,7 @@ test('Captures POST route errors', async ({ baseURL, request }) => {
8585

8686
expect(errorEvent.exception?.values?.[0]?.value).toBe('Post error');
8787
expect(errorEvent.exception?.values?.[0]?.mechanism).toEqual({
88-
type: 'elysia',
88+
type: 'auto.http.elysia.on_error',
8989
handled: false,
9090
});
9191
});
@@ -102,7 +102,7 @@ test('Captures thrown string errors', async ({ baseURL, request }) => {
102102
expect(errorEvent.exception?.values?.[0]?.value).toBe('String error message');
103103
expect(errorEvent.exception?.values?.[0]?.mechanism).toEqual(
104104
expect.objectContaining({
105-
type: 'elysia',
105+
type: 'auto.http.elysia.on_error',
106106
handled: false,
107107
}),
108108
);

packages/elysia/.oxlintrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"$schema": "../../node_modules/oxlint/configuration_schema.json",
3-
"extends": ["../../.oxlintrc.json"],
3+
"extends": ["../../.oxlintrc.json"]
44
}

0 commit comments

Comments
 (0)