diff --git a/package.json b/package.json index 2fe1e8b49..b316353c7 100644 --- a/package.json +++ b/package.json @@ -56,7 +56,7 @@ "@types/eslint": "^9.6.1", "@types/jest": "^30.0.0", "@types/jest-axe": "^3.5.9", - "@types/node": "22.15.30", + "@types/node": "24.6.0", "@types/react": "^19.1.10", "@types/react-dom": "^19.1.7", "@typescript-eslint/eslint-plugin": "^8.22.0", diff --git a/src/test/index.ts b/src/test/index.ts index c123e4312..fc77b0144 100644 --- a/src/test/index.ts +++ b/src/test/index.ts @@ -7,16 +7,20 @@ expect.extend(toHaveNoViolations); const originalError = console.error; beforeAll(() => { console.error = (...args) => { - // Check if any of the arguments contains the floating-ui act warning - const hasFloatingActWarning = args.some( - (arg) => - typeof arg === "string" && - arg.includes( - "An update to withFloating(PopperComponent) inside a test was not wrapped in act", - ), - ); + // Check the first argument (the error message) + const firstArg = args[0]; + const firstArgStr = + typeof firstArg === "string" + ? firstArg + : firstArg instanceof Error + ? firstArg.message + : String(firstArg); - if (hasFloatingActWarning) { + // Suppress floating-ui act warnings + if ( + firstArgStr.includes("An update to withFloating(PopperComponent)") && + firstArgStr.includes("inside a test was not wrapped in act") + ) { return; } diff --git a/tsconfig.json b/tsconfig.json index 627d4aa15..96f9424db 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -9,7 +9,7 @@ "noUncheckedIndexedAccess": true, "module": "esnext", "target": "ES2015", - "lib": ["ES2021", "dom"], + "lib": ["ES2022", "dom"], "sourceMap": true, "jsx": "react", "moduleResolution": "node", diff --git a/yarn.lock b/yarn.lock index cf5a0aebc..10e6a43eb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3442,12 +3442,12 @@ __metadata: languageName: node linkType: hard -"@types/node@npm:22.15.30": - version: 22.15.30 - resolution: "@types/node@npm:22.15.30" +"@types/node@npm:24.6.0": + version: 24.6.0 + resolution: "@types/node@npm:24.6.0" dependencies: - undici-types: "npm:~6.21.0" - checksum: 10c0/ca330ac0e7fd502686d6df115fcc606aba46fd334220f749bbba2f639accdadcb23f7900603ceccdc8240be736739cad5c0b87c0fa92c9255a4dff245f07d664 + undici-types: "npm:~7.13.0" + checksum: 10c0/06f1aa1b5d9a8c26285b34c25aee554f31a1dc0b39627cc14e7c1c6967e75a47ab9f409eee14796cbcc004ae4059fa884cb6092ecfb368c9656d16686d7cc9d8 languageName: node linkType: hard @@ -9480,7 +9480,7 @@ __metadata: "@types/eslint": "npm:^9.6.1" "@types/jest": "npm:^30.0.0" "@types/jest-axe": "npm:^3.5.9" - "@types/node": "npm:22.15.30" + "@types/node": "npm:24.6.0" "@types/react": "npm:^19.1.10" "@types/react-dom": "npm:^19.1.7" "@typescript-eslint/eslint-plugin": "npm:^8.22.0" @@ -11160,10 +11160,10 @@ __metadata: languageName: node linkType: hard -"undici-types@npm:~6.21.0": - version: 6.21.0 - resolution: "undici-types@npm:6.21.0" - checksum: 10c0/c01ed51829b10aa72fc3ce64b747f8e74ae9b60eafa19a7b46ef624403508a54c526ffab06a14a26b3120d055e1104d7abe7c9017e83ced038ea5cf52f8d5e04 +"undici-types@npm:~7.13.0": + version: 7.13.0 + resolution: "undici-types@npm:7.13.0" + checksum: 10c0/44bbb0935425291351bfd8039571f017295b5d6dc5727045d0a4fea8c6ffe73a6703b48ce010f9cb539b9041a75b463f8cfe1e7309cab7486452505fb0d66151 languageName: node linkType: hard