Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 1.8k
test(remix): Run tsc before Remix E2E tests#16345
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
c903f1751d089fb24ebeddc1cb5dc0309d41936b6f13c9bbaa5b31808d24fd279acb208fb25f14e1e37e6780114aecdf2b5bf3c54File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -20,7 +20,7 @@ test('Sends parameterized transaction name to Sentry', async ({ page }) => { | ||
| test('Sends form data with action span', async ({ page }) => { | ||
| const formdataActionTransaction = waitForTransaction('create-remix-app-express', transactionEvent => { | ||
| return transactionEvent?.spans?.some(span => span.data && span.data['code.function'] === 'action'); | ||
| return transactionEvent?.spans?.some(span => span.data && span.data['code.function'] === 'action') || false; | ||
| }); | ||
| await page.goto('/action-formdata'); | ||
| @@ -34,31 +34,31 @@ test('Sends form data with action span', async ({ page }) => { | ||
| await page.locator('button[type=submit]').click(); | ||
| const actionSpan = (await formdataActionTransaction).spans.find( | ||
| const actionSpan = (await formdataActionTransaction)?.spans?.find( | ||
| span => span.data && span.data['code.function'] === 'action', | ||
| ); | ||
| expect(actionSpan).toBeDefined(); | ||
| expect(actionSpan.op).toBe('action.remix'); | ||
| expect(actionSpan.data).toMatchObject({ | ||
| expect(actionSpan?.op).toBe('action.remix'); | ||
| expect(actionSpan?.data).toMatchObject({ | ||
| 'formData.text': 'test', | ||
| 'formData.file': 'file.txt', | ||
| }); | ||
| }); | ||
| test('Sends a loader span to Sentry', async ({ page }) => { | ||
| const loaderTransactionPromise = waitForTransaction('create-remix-app-express', transactionEvent => { | ||
| return transactionEvent?.spans?.some(span => span.data && span.data['code.function'] === 'loader'); | ||
| return transactionEvent?.spans?.some(span => span.data && span.data['code.function'] === 'loader') || false; | ||
andreiborza marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| }); | ||
| await page.goto('/'); | ||
| const loaderSpan = (await loaderTransactionPromise).spans.find( | ||
| const loaderSpan = (await loaderTransactionPromise)?.spans?.find( | ||
| span => span.data && span.data['code.function'] === 'loader', | ||
| ); | ||
| expect(loaderSpan).toBeDefined(); | ||
| expect(loaderSpan.op).toBe('loader.remix'); | ||
| expect(loaderSpan?.op).toBe('loader.remix'); | ||
| }); | ||
| test('Propagates trace when ErrorBoundary is triggered', async ({ page }) => { | ||
| @@ -83,9 +83,8 @@ test('Propagates trace when ErrorBoundary is triggered', async ({ page }) => { | ||
| const httpServerTraceId = httpServerTransaction.contexts?.trace?.trace_id; | ||
| const httpServerSpanId = httpServerTransaction.contexts?.trace?.span_id; | ||
| const loaderSpanId = httpServerTransaction.spans.find( | ||
| span => span.data && span.data['code.function'] === 'loader', | ||
| )?.span_id; | ||
| const loaderSpanId = httpServerTransaction?.spans?.find(span => span.data && span.data['code.function'] === 'loader') | ||
| ?.span_id; | ||
| const pageLoadTraceId = pageloadTransaction.contexts?.trace?.trace_id; | ||
| const pageLoadSpanId = pageloadTransaction.contexts?.trace?.span_id; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,12 +1,16 @@ | ||
| import {createPagesFunctionHandler} from '@remix-run/cloudflare-pages'; | ||
| import {sentryPagesPlugin} from '@sentry/cloudflare'; | ||
| import {createPagesFunctionHandler} from '@remix-run/cloudflare-pages'; | ||
| import {sentryPagesPlugin} from '@sentry/cloudflare'; | ||
| // eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
| // @ts-ignore - the server build file is generated by `remix vite:build` | ||
| // eslint-disable-next-line import/no-unresolved | ||
| import * as build from '../build/server'; | ||
| export const onRequest = [ | ||
| context => sentryPagesPlugin({ dsn: context.env.E2E_TEST_DSN, tracesSampleRate: 1.0 })(context), | ||
| createPagesFunctionHandler({ build }), | ||
| (context: EventPluginContext<any, any, any, any>) => | ||
| sentryPagesPlugin({ | ||
| dsn: context.env.E2E_TEST_DSN, | ||
| tracesSampleRate: 1.0, | ||
| })(context), | ||
| createPagesFunctionHandler({build}), | ||
| ]; |
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
q: What does adding
|| falsedo here?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
waitForTransactionexpects a function returning aboolean, after adding optional chaining, it becameboolean | undefined. So, making itfalsein such casesThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah... of course 😅 thanks