MCPcopy Index your code
hub / github.com/codeceptjs/CodeceptJS / getHelperModuleName

Function getHelperModuleName

lib/container.js:998–1019  ·  view source on GitHub ↗
(helperName, config)

Source from the content-addressed store, hash-verified

996}
997
998function 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}
1020function normalizeAndJoin(basePath, subPath) {
1021 // Normalize and convert slashes to forward slashes in one step
1022 const normalizedBase = path.posix.normalize(basePath.replace(/\\/g, '/'))

Callers 1

requireHelperFromModuleFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected