From a2371997edd93da08f3192d8aac5339fbe1f388a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nacho=20Codo=C3=B1er?= Date: Mon, 1 Sep 2025 15:27:38 +0200 Subject: [PATCH] fix typescript modern test --- tools/modern-tests/typescript.test.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/tools/modern-tests/typescript.test.js b/tools/modern-tests/typescript.test.js index 601cc0de9f..9888b4c044 100644 --- a/tools/modern-tests/typescript.test.js +++ b/tools/modern-tests/typescript.test.js @@ -64,3 +64,25 @@ export async function waitForTypeScriptEnvs(outputLines, options = {}) { ); } } + +/** + * Helper function to wait for TypeScript error-free output from both Rspack Client and Server + * @param {string[]} outputLines - Array that will be populated with output lines + * @param {Object} options - Options for waiting + * @param {number} options.timeout - Maximum time to wait in milliseconds + * @param {number} options.checkInterval - Interval between checks in milliseconds + * @returns {Promise} - A promise that resolves when both client and server are error-free + */ +export async function waitForTypeScriptErrorFree(outputLines, options = {}) { + await waitForMeteorOutput( + outputLines, + /.*\[Rspack.*Client].*No TypeScript errors found\./, + options + ); + await waitForMeteorOutput( + outputLines, + /.*\[Rspack.*Server].*No TypeScript errors found\./, + options + ); + console.log(`Custom Plugin usage: ts-checker-rspack-plugin`); +}