Skip to content

Commit 4a3a11a

Browse files
committed
test: use TypeScript for SSR compatibility fixture
1 parent 19d68e4 commit 4a3a11a

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@ import { useInView } from "react-intersection-observer";
44

55
const { renderToString } = createRequire(import.meta.url)("react-dom/server");
66

7-
const errors = [];
7+
const errors: string[] = [];
88
const originalError = console.error;
9-
console.error = (...arguments_) => errors.push(arguments_.join(" "));
9+
console.error = (...arguments_: unknown[]) =>
10+
errors.push(arguments_.map(String).join(" "));
1011

1112
try {
1213
function CompatibilityFixture() {

‎scripts/compat/packed.mts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ try {
8282

8383
await exec("pnpm", ["install"], { cwd: packageDirectory });
8484
await exec("pnpm", ["build"], { cwd: packageDirectory });
85-
await exec("node", ["ssr.mjs"], { cwd: packageDirectory });
85+
await exec("node", ["ssr.mts"], { cwd: packageDirectory });
8686

8787
console.log(`React ${major} packed build and SSR passed`);
8888
} finally {

0 commit comments

Comments
 (0)