Skip to content

πŸ™Œ OpenHands: AI-Driven Development

deps(deps-dev): bump typescript from 5.9.3 to 6.0.3 (#34)

dependabot[bot]438f51a2241e
diff --git a/__tests__/components/chat/message-display-continuity.test.tsx b/__tests__/components/chat/message-display-continuity.test.tsx
index bfece0f37a..e16166e939 100644
--- a/__tests__/components/chat/message-display-continuity.test.tsx
+++ b/__tests__/components/chat/message-display-continuity.test.tsx
@@ -49,6 +49,27 @@ vi.mock("#/hooks/use-agent-state", () => ({
})),
}));
+vi.mock("#/components/features/chat/btw-messages", () => ({
+ BtwMessages: () => <div data-testid="btw-messages" />,
+}));
+
+vi.mock("#/components/features/chat/chat-suggestions", () => ({
+ ChatSuggestions: () => <div data-testid="chat-suggestions" />,
+}));
+
+vi.mock("#/components/features/chat/interactive-chat-box", () => ({
+ InteractiveChatBox: () => <div data-testid="interactive-chat-box" />,
+}));
+
+vi.mock("#/components/shared/buttons/scroll-to-bottom-button", () => ({
+ ScrollToBottomButton: () => <button type="button">Scroll to bottom</button>,
+}));
+
+vi.mock("#/components/v1/chat", async (importOriginal) => ({
+ ...(await importOriginal<typeof import("#/components/v1/chat")>()),
+ Messages: () => <div data-testid="v1-messages" />,
+}));
+
// Helper to render with QueryClient and route params
const renderWithQueryClient = (
ui: React.ReactElement,
diff --git a/__tests__/components/shared/buttons/automations-button.test.tsx b/__tests__/components/shared/buttons/automations-button.test.tsx
index e50c601d5e..8366398a5f 100644
--- a/__tests__/components/shared/buttons/automations-button.test.tsx
+++ b/__tests__/components/shared/buttons/automations-button.test.tsx
@@ -1,7 +1,11 @@
import { createEvent, fireEvent, render, screen } from "@testing-library/react";
-import { describe, expect, it } from "vitest";
+import { describe, expect, it, vi } from "vitest";
import { AutomationsButton } from "#/components/shared/buttons/automations-button";
+vi.mock("#/components/shared/buttons/styled-tooltip", () => ({
+ StyledTooltip: ({ children }: { children: unknown }) => children,
+}));
+
describe("AutomationsButton", () => {
it("should render a link to /automations", () => {
render(<AutomationsButton />);
diff --git a/__tests__/hooks/use-websocket.test.ts b/__tests__/hooks/use-websocket.test.ts
index d00db6f856..6e6c6f17f9 100644
--- a/__tests__/hooks/use-websocket.test.ts
+++ b/__tests__/hooks/use-websocket.test.ts
@@ -42,6 +42,21 @@ describe("useWebSocket", () => {
afterEach(() => mswServer.resetHandlers());
afterAll(() => mswServer.close());
+ const waitForConnection = async (
+ result: {
+ current: {
+ isConnected: boolean;
+ };
+ },
+ ) => {
+ await waitFor(
+ () => {
+ expect(result.current.isConnected).toBe(true);
+ },
+ { timeout: 5000 },
+ );
+ };
+
it("should establish a WebSocket connection", async () => {
const { result } = renderHook(() => useWebSocket("ws://acme.com/ws"));
@@ -50,9 +65,7 @@ describe("useWebSocket", () => {
expect(result.current.lastMessage).toBe(null);
// Wait for connection to be established
- await waitFor(() => {
- expect(result.current.isConnected).toBe(true);
- });
+ await waitForConnection(result);
// Should receive the welcome message from our mock
await waitFor(() => {
@@ -160,9 +173,7 @@ describe("useWebSocket", () => {
const { result } = renderHook(() => useWebSocket(baseUrl, { queryParams }));
// Wait for connection to be established
- await waitFor(() => {
- expect(result.current.isConnected).toBe(true);
- });
+ await waitForConnection(result);
// Verify that the WebSocket was created with query parameters
expect(result.current.socket).toBeTruthy();
@@ -184,9 +195,7 @@ describe("useWebSocket", () => {
expect(onOpenSpy).not.toHaveBeenCalled();
// Wait for connection to be established
- await waitFor(() => {
- expect(result.current.isConnected).toBe(true);
- });
+ await waitForConnection(result);
// onOpen handler should have been called
expect(onOpenSpy).toHaveBeenCalledOnce();
@@ -201,9 +210,7 @@ describe("useWebSocket", () => {
);
// Wait for connection to be established
- await waitFor(() => {
- expect(result.current.isConnected).toBe(true);
- });
+ await waitForConnection(result);
// Reset spy after connection is established to ignore any spurious
// close events fired by the MSW mock during the handshake.
diff --git a/package-lock.json b/package-lock.json
index 7959a0a0a5..223fc8df5f 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -85,7 +85,7 @@
"msw": "2.13.4",
"prettier": "3.8.3",
"tailwindcss": "4.2.2",
- "typescript": "5.9.3",
+ "typescript": "6.0.3",
"vite-plugin-svgr": "4.5.0",
"vite-tsconfig-paths": "6.1.1",
"vitest": "4.1.4"
@@ -16848,27 +16848,6 @@
"typescript": ">=4.2.0"
}
},
- "node_modules/tsconfck": {
- "version": "3.1.6",
- "resolved": "https://registry.npmjs.org/tsconfck/-/tsconfck-3.1.6.tgz",
- "integrity": "sha512-ks6Vjr/jEw0P1gmOVwutM3B7fWxoWBL2KRDb1JfqGVawBmO5UsvmWOQFGHBPl5yxYz4eERr19E6L7NMv+Fej4w==",
- "dev": true,
- "license": "MIT",
- "bin": {
- "tsconfck": "bin/tsconfck.js"
- },
- "engines": {
- "node": "^18 || >=20"
- },
- "peerDependencies": {
- "typescript": "^5.0.0"
- },
- "peerDependenciesMeta": {
- "typescript": {
- "optional": true
- }
- }
- },
"node_modules/tsconfig-paths": {
"version": "3.15.0",
"resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz",
@@ -17019,11 +16998,10 @@
}
},
"node_modules/typescript": {
- "version": "5.9.3",
- "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz",
- "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==",
+ "version": "6.0.3",
+ "resolved": "https://registry.npmjs.org/typescript/-/typescript-6.0.3.tgz",
+ "integrity": "sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw==",
"devOptional": true,
- "license": "Apache-2.0",
"bin": {
"tsc": "bin/tsc",
"tsserver": "bin/tsserver"
@@ -17559,6 +17537,41 @@
"vite": "*"
}
},
+ "node_modules/vite-tsconfig-paths/node_modules/tsconfck": {
+ "version": "3.1.6",
+ "resolved": "https://registry.npmjs.org/tsconfck/-/tsconfck-3.1.6.tgz",
+ "integrity": "sha512-ks6Vjr/jEw0P1gmOVwutM3B7fWxoWBL2KRDb1JfqGVawBmO5UsvmWOQFGHBPl5yxYz4eERr19E6L7NMv+Fej4w==",
+ "dev": true,
+ "bin": {
+ "tsconfck": "bin/tsconfck.js"
+ },
+ "engines": {
+ "node": "^18 || >=20"
+ },
+ "peerDependencies": {
+ "typescript": "^5.0.0"
+ },
+ "peerDependenciesMeta": {
+ "typescript": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/vite-tsconfig-paths/node_modules/typescript": {
+ "version": "5.9.3",
+ "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz",
+ "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==",
+ "dev": true,
+ "optional": true,
+ "peer": true,
+ "bin": {
+ "tsc": "bin/tsc",
+ "tsserver": "bin/tsserver"
+ },
+ "engines": {
+ "node": ">=14.17"
+ }
+ },
"node_modules/vite/node_modules/fsevents": {
"version": "2.3.3",
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz",
diff --git a/package.json b/package.json
index 9790ce35b5..b0c3bd3824 100644
--- a/package.json
+++ b/package.json
@@ -119,7 +119,7 @@
"msw": "2.13.4",
"prettier": "3.8.3",
"tailwindcss": "4.2.2",
- "typescript": "5.9.3",
+ "typescript": "6.0.3",
"vite-plugin-svgr": "4.5.0",
"vite-tsconfig-paths": "6.1.1",
"vitest": "4.1.4"
diff --git a/vitest.setup.ts b/vitest.setup.ts
index acb1f2acc2..b72e65cb6a 100644
--- a/vitest.setup.ts
+++ b/vitest.setup.ts
@@ -11,8 +11,22 @@ if (typeof HTMLElement !== "undefined") {
HTMLElement.prototype.scrollTo = vi.fn();
}
-if (typeof window !== "undefined") {
- window.scrollTo = vi.fn();
+const windowStub =
+ typeof window === "undefined"
+ ? ({ event: undefined } as unknown as Window & typeof globalThis)
+ : window;
+
+vi.stubGlobal("window", windowStub);
+windowStub.scrollTo = vi.fn();
+
+if (typeof requestAnimationFrame === "undefined") {
+ vi.stubGlobal("requestAnimationFrame", (callback: FrameRequestCallback) =>
+ setTimeout(() => callback(0), 0),
+ );
+ vi.stubGlobal(
+ "cancelAnimationFrame",
+ (timeoutId: ReturnType<typeof setTimeout>) => clearTimeout(timeoutId),
+ );
}
// Mock ResizeObserver for test environment