diff --git a/packages/create-wdio/src/utils.ts b/packages/create-wdio/src/utils.ts index fc4e95847..f7aebbaec 100644 --- a/packages/create-wdio/src/utils.ts +++ b/packages/create-wdio/src/utils.ts @@ -28,7 +28,7 @@ const __dirname = path.dirname(url.fileURLToPath(import.meta.url)) process.on('SIGINT', () => printAndExit(undefined, 'SIGINT')) -const TEMPLATE_ROOT_DIR = path.join(__dirname, 'templates', 'exampleFiles') +const TEMPLATE_ROOT_DIR = path.join(__dirname, '..', 'templates', 'exampleFiles') export function runProgram (command: string, args: string[], options: SpawnOptions) { const child = spawn(command, args, { stdio: 'inherit', ...options }) @@ -528,7 +528,7 @@ export function addServiceDeps(names: SupportedPackage[], packages: string[], up export async function createWDIOConfig(parsedAnswers: ParsedAnswers) { try { console.log('Creating a WebdriverIO config file...') - const tplPath = path.resolve(__dirname, 'templates', 'wdio.conf.tpl.ejs') + const tplPath = path.resolve(__dirname, '..', 'templates', 'wdio.conf.tpl.ejs') const renderedTpl = await renderFile(tplPath, { answers: parsedAnswers, _: new EjsHelpers({ useEsm: parsedAnswers.esmSupport, useTypeScript: parsedAnswers.isUsingTypeScript })