| 112 | * @returns {string|null} Warning message or null |
| 113 | */ |
| 114 | export function getTSNodeESMWarning(requiredModules = []) { |
| 115 | if (!requiredModules.includes('ts-node/esm')) { |
| 116 | return null |
| 117 | } |
| 118 | |
| 119 | return ` |
| 120 | ⚠️ Warning: ts-node/esm with "module": "esnext" requires explicit file extensions in all imports. |
| 121 | |
| 122 | This is a known limitation. Use tsx/cjs instead to write imports without extensions. |
| 123 | |
| 124 | Examples: |
| 125 | |
| 126 | ❌ Incorrect (will fail): |
| 127 | import loginPage from "./pages/Login"; |
| 128 | |
| 129 | ✅ Correct (must include .ts extension): |
| 130 | import loginPage from "./pages/Login.ts"; |
| 131 | |
| 132 | 📚 Documentation: https://codecept.io/typescript |
| 133 | |
| 134 | ` |
| 135 | } |
| 136 | |
| 137 | /** |
| 138 | * Check if user is trying to run TypeScript tests without proper loader |