Skip to content

Commit d06b72b

Browse files
authored
test(remix): Run tsc before Remix E2E tests (#16345)
Following up: #16336
1 parent 93b72ff commit d06b72b

File tree

26 files changed

+161
-96
lines changed

26 files changed

+161
-96
lines changed

dev-packages/e2e-tests/test-applications/create-remix-app-express-vite-dev/app/entry.client.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,16 @@ import * as Sentry from '@sentry/remix';
33
import { StrictMode, startTransition, useEffect } from 'react';
44
import { hydrateRoot } from 'react-dom/client';
55

6+
// Extend the Window interface to include ENV
7+
declare global {
8+
interface Window {
9+
ENV: {
10+
SENTRY_DSN: string;
11+
[key: string]: unknown;
12+
};
13+
}
14+
}
15+
616
Sentry.init({
717
environment: 'qa', // dynamic sampling bias to keep transactions
818
dsn: window.ENV.SENTRY_DSN,

dev-packages/e2e-tests/test-applications/create-remix-app-express-vite-dev/app/entry.server.tsx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,6 @@ function isBotRequest(userAgent: string | null) {
4040
return isbotModule.isbot(userAgent);
4141
}
4242

43-
// isbot < 3.8.0
44-
if ('default' in isbotModule && typeof isbotModule.default === 'function') {
45-
return isbotModule.default(userAgent);
46-
}
47-
4843
return false;
4944
}
5045

dev-packages/e2e-tests/test-applications/create-remix-app-express-vite-dev/app/root.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export function ErrorBoundary() {
5252
}
5353

5454
function App() {
55-
const { ENV } = useLoaderData();
55+
const { ENV } = useLoaderData() as { ENV: { SENTRY_DSN: string } };
5656

5757
return (
5858
<html lang="en">

dev-packages/e2e-tests/test-applications/create-remix-app-express-vite-dev/app/routes/navigate.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export const loader: LoaderFunction = async ({ params: { id } }) => {
1010
};
1111

1212
export default function LoaderError() {
13-
const data = useLoaderData();
13+
const data = useLoaderData() as { test?: string };
1414

1515
return (
1616
<div>

dev-packages/e2e-tests/test-applications/create-remix-app-express-vite-dev/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"private": true,
33
"sideEffects": false,
44
"scripts": {
5-
"build": "remix vite:build",
5+
"build": "remix vite:build && pnpm typecheck",
66
"dev": "node ./server.mjs",
77
"lint": "eslint --ignore-path .gitignore --cache --cache-location ./node_modules/.cache/eslint .",
88
"start": "cross-env NODE_ENV=production node ./server.mjs",

dev-packages/e2e-tests/test-applications/create-remix-app-express/app/entry.client.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,16 @@ import * as Sentry from '@sentry/remix';
33
import { StrictMode, startTransition, useEffect } from 'react';
44
import { hydrateRoot } from 'react-dom/client';
55

6+
// Extend the Window interface to include ENV
7+
declare global {
8+
interface Window {
9+
ENV: {
10+
SENTRY_DSN: string;
11+
[key: string]: unknown;
12+
};
13+
}
14+
}
15+
616
Sentry.init({
717
environment: 'qa', // dynamic sampling bias to keep transactions
818
dsn: window.ENV.SENTRY_DSN,

dev-packages/e2e-tests/test-applications/create-remix-app-express/app/entry.server.tsx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,6 @@ function isBotRequest(userAgent: string | null) {
4040
return isbotModule.isbot(userAgent);
4141
}
4242

43-
// isbot < 3.8.0
44-
if ('default' in isbotModule && typeof isbotModule.default === 'function') {
45-
return isbotModule.default(userAgent);
46-
}
47-
4843
return false;
4944
}
5045

dev-packages/e2e-tests/test-applications/create-remix-app-express/app/root.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export function ErrorBoundary() {
5252
}
5353

5454
function App() {
55-
const { ENV } = useLoaderData();
55+
const { ENV } = useLoaderData() as { ENV: { SENTRY_DSN: string } };
5656

5757
return (
5858
<html lang="en">

dev-packages/e2e-tests/test-applications/create-remix-app-express/app/routes/navigate.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export const loader: LoaderFunction = async ({ params: { id } }) => {
1010
};
1111

1212
export default function LoaderError() {
13-
const data = useLoaderData();
13+
const data = useLoaderData() as { test?: string };
1414

1515
return (
1616
<div>

dev-packages/e2e-tests/test-applications/create-remix-app-express/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"sideEffects": false,
44
"type": "module",
55
"scripts": {
6-
"build": "remix vite:build",
6+
"build": "remix vite:build && pnpm typecheck",
77
"dev": "node ./server.mjs",
88
"lint": "eslint --ignore-path .gitignore --cache --cache-location ./node_modules/.cache/eslint .",
99
"start": "cross-env NODE_ENV=production node ./server.mjs",

0 commit comments

Comments
 (0)