Commit 076655f
committed
fix(e2e): Explicitly add Spotlight integration in test app
The automatic Spotlight enablement via VITE_SENTRY_SPOTLIGHT env var
only works with the SDK's dev builds (spotlight code is stripped from
prod builds). For E2E testing, we explicitly add the integration.
This tests that:
1. The VITE_SENTRY_SPOTLIGHT env var is correctly parsed by Vite
2. The spotlightBrowserIntegration correctly sends events to the sidecar
Note on webpack node_modules issue:
Webpack's DefinePlugin does NOT replace process.env values in code under
node_modules by default. This means setting process.env.SENTRY_SPOTLIGHT
in DefinePlugin won't work for SDK code that checks this env var.
Solutions:
- Use Vite which properly handles import.meta.env replacements
- Use framework SDKs like @sentry/nextjs which inject env vars differently
- Explicitly add spotlightBrowserIntegration with the URL1 parent 5a19725 commit 076655f
File tree
2 files changed
+23
-13
lines changed- dev-packages/e2e-tests/test-applications/browser-spotlight
- src
- tests
2 files changed
+23
-13
lines changedLines changed: 14 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | | - | |
9 | | - | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
10 | 13 | | |
11 | 14 | | |
12 | | - | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
13 | 23 | | |
14 | 24 | | |
15 | 25 | | |
16 | 26 | | |
17 | 27 | | |
18 | 28 | | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | 29 | | |
23 | 30 | | |
24 | 31 | | |
25 | 32 | | |
26 | | - | |
27 | 33 | | |
28 | 34 | | |
29 | 35 | | |
| |||
Lines changed: 9 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | | - | |
| 8 | + | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
12 | 16 | | |
13 | 17 | | |
14 | 18 | | |
15 | 19 | | |
16 | 20 | | |
17 | 21 | | |
18 | | - | |
| 22 | + | |
19 | 23 | | |
20 | 24 | | |
21 | 25 | | |
| |||
55 | 59 | | |
56 | 60 | | |
57 | 61 | | |
58 | | - | |
| 62 | + | |
59 | 63 | | |
60 | 64 | | |
61 | 65 | | |
| |||
0 commit comments