You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .cursor/rules/sdk_development.mdc
+48Lines changed: 48 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -121,6 +121,54 @@ Each package typically contains:
121
121
- Integration tests use Playwright extensively
122
122
- Never change the volta, yarn, or package manager setup in general unless explicitly asked for
123
123
124
+
### E2E Testing
125
+
126
+
E2E tests are located in `dev-packages/e2e-tests/` and verify SDK behavior in real-world framework scenarios.
127
+
128
+
#### How Verdaccio Registry Works
129
+
130
+
E2E tests use [Verdaccio](https://verdaccio.org/), a lightweight npm registry running in Docker. Before tests run:
131
+
132
+
1. SDK packages are built and packed into tarballs (`yarn build && yarn build:tarball`)
133
+
2. Tarballs are published to Verdaccio at `http://127.0.0.1:4873`
134
+
3. Test applications install packages from Verdaccio instead of public npm
135
+
136
+
#### The `.npmrc` Requirement
137
+
138
+
Every E2E test application needs an `.npmrc` file with:
139
+
140
+
```
141
+
@sentry:registry=http://127.0.0.1:4873
142
+
@sentry-internal:registry=http://127.0.0.1:4873
143
+
```
144
+
145
+
Without this file, pnpm installs from the public npm registry instead of Verdaccio, so your local changes won't be tested. This is a common cause of "tests pass in CI but fail locally" or vice versa.
146
+
147
+
#### Running a Single E2E Test
148
+
149
+
```bash
150
+
# Build packages first
151
+
yarn build && yarn build:tarball
152
+
153
+
# Run a specific test app
154
+
cd dev-packages/e2e-tests
155
+
yarn test:run <app-name>
156
+
157
+
# Run with a specific variant (e.g., Next.js 15)
158
+
yarn test:run <app-name> --variant <variant-name>
159
+
```
160
+
161
+
#### Common Pitfalls and Debugging
162
+
163
+
1. **Missing `.npmrc`**: Most common issue. Always verify the test app has the correct `.npmrc` file.
164
+
165
+
2. **Stale tarballs**: After SDK changes, must re-run `yarn build:tarball`.
166
+
167
+
3. **Debugging tips**:
168
+
- Check browser console logs for SDK initialization errors
0 commit comments