Skip to content

Commit 5c08d03

Browse files
authored
test(e2e): Add Astro 4 E2E test app (#13375)
1 parent 7aebf94 commit 5c08d03

File tree

26 files changed

+673
-1
lines changed

26 files changed

+673
-1
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -847,6 +847,7 @@ jobs:
847847
[
848848
'angular-17',
849849
'angular-18',
850+
'astro-4',
850851
'aws-lambda-layer-cjs',
851852
'aws-serverless-esm',
852853
'node-express',
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# build output
2+
dist/
3+
4+
# generated types
5+
.astro/
6+
7+
# dependencies
8+
node_modules/
9+
10+
# logs
11+
npm-debug.log*
12+
yarn-debug.log*
13+
yarn-error.log*
14+
pnpm-debug.log*
15+
16+
# environment variables
17+
.env
18+
.env.production
19+
20+
# macOS-specific files
21+
.DS_Store
22+
23+
# jetbrains setting folder
24+
.idea/
25+
26+
test-results
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
@sentry:registry=http://127.0.0.1:4873
2+
@sentry-internal:registry=http://127.0.0.1:4873
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Astro 4 E2E test app
2+
3+
- Astro 4.x
4+
- Output mode `hybrid` (== opt into SSR routes)
5+
- Node adapter
6+
- Configured for Tracing and Performance
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import node from '@astrojs/node';
2+
import sentry from '@sentry/astro';
3+
import { defineConfig } from 'astro/config';
4+
5+
import spotlightjs from '@spotlightjs/astro';
6+
7+
// https://astro.build/config
8+
export default defineConfig({
9+
output: 'hybrid',
10+
integrations: [
11+
sentry({
12+
debug: true,
13+
sourceMapsUploadOptions: {
14+
enabled: false,
15+
},
16+
}),
17+
spotlightjs(),
18+
],
19+
adapter: node({
20+
mode: 'standalone',
21+
}),
22+
vite: {
23+
build: {
24+
rollupOptions: {
25+
external: ['https'],
26+
},
27+
},
28+
},
29+
});
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"name": "astro-hybrid-with-static-routes",
3+
"type": "module",
4+
"version": "0.0.1",
5+
"scripts": {
6+
"dev": "astro dev --force",
7+
"start": "astro dev",
8+
"build": "astro check && astro build",
9+
"preview": "astro preview",
10+
"astro": "astro",
11+
"test:build": "pnpm install && npx playwright install && pnpm build",
12+
"test:assert": "TEST_ENV=production playwright test"
13+
},
14+
"dependencies": {
15+
"@astrojs/check": "^0.9.2",
16+
"@astrojs/node": "^8.3.2",
17+
"@playwright/test": "^1.46.0",
18+
"@sentry/astro": "* || latest",
19+
"@sentry-internal/test-utils": "link:../../../test-utils",
20+
"@spotlightjs/astro": "^2.1.6",
21+
"astro": "^4.13.3",
22+
"typescript": "^5.5.4"
23+
},
24+
"devDependencies": {
25+
"@astrojs/internal-helpers": "^0.4.1"
26+
}
27+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { getPlaywrightConfig } from '@sentry-internal/test-utils';
2+
3+
const testEnv = process.env.TEST_ENV;
4+
5+
if (!testEnv) {
6+
throw new Error('No test env defined');
7+
}
8+
9+
const config = getPlaywrightConfig({
10+
startCommand: 'node ./dist/server/entry.mjs',
11+
});
12+
13+
export default config;
Lines changed: 9 additions & 0 deletions
Loading
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import * as Sentry from '@sentry/astro';
2+
3+
Sentry.init({
4+
dsn: import.meta.env.PUBLIC_E2E_TEST_DSN,
5+
environment: 'qa',
6+
tracesSampleRate: 1.0,
7+
tunnel: 'http://localhost:3031/', // proxy server
8+
});
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import * as Sentry from '@sentry/astro';
2+
3+
Sentry.init({
4+
dsn: import.meta.env.PUBLIC_E2E_TEST_DSN,
5+
environment: 'qa',
6+
tracesSampleRate: 1.0,
7+
spotlight: true,
8+
tunnel: 'http://localhost:3031/', // proxy server
9+
});

0 commit comments

Comments
 (0)