(helperName, config)
| 996 | } |
| 997 | |
| 998 | function getHelperModuleName(helperName, config) { |
| 999 | // classical require |
| 1000 | if (config[helperName].require) { |
| 1001 | if (config[helperName].require.startsWith('.')) { |
| 1002 | let helperPath = path.resolve(store.codeceptDir, config[helperName].require) |
| 1003 | // Add .js extension if not present for ESM compatibility |
| 1004 | if (!path.extname(helperPath)) { |
| 1005 | helperPath += '.js' |
| 1006 | } |
| 1007 | return helperPath // custom helper |
| 1008 | } |
| 1009 | return config[helperName].require // plugin helper |
| 1010 | } |
| 1011 | |
| 1012 | // built-in helpers |
| 1013 | if (helperName.startsWith('@codeceptjs/')) { |
| 1014 | return helperName |
| 1015 | } |
| 1016 | |
| 1017 | // built-in helpers |
| 1018 | return `./helper/${helperName}` |
| 1019 | } |
| 1020 | function normalizeAndJoin(basePath, subPath) { |
| 1021 | // Normalize and convert slashes to forward slashes in one step |
| 1022 | const normalizedBase = path.posix.normalize(basePath.replace(/\\/g, '/')) |
no outgoing calls
no test coverage detected