Skip to content

Commit

Permalink
modifying wdio script for ts
Browse files Browse the repository at this point in the history
Signed-off-by: Vignesh Mohanasundaram <vigneshmohan243@yahoo.com>
  • Loading branch information
vigneshmohan243 committed Jan 26, 2022
1 parent a578504 commit d6fd884
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,12 @@ async function createWebdriverIO(opts: ProgramOpts) {
console.log('Adding scripts to package.json')

const pkgJson = require(pkgJsonPath)
const isUsingTypescript = await exists('wdio.conf.ts')
const isUsingTypescript = await exists('test/wdio.conf.ts')

if (!pkgJson.scripts) {
pkgJson.scripts = {}
}
pkgJson.scripts['wdio'] = `wdio run wdio.conf.${isUsingTypescript ? 'ts' : 'js'}`
pkgJson.scripts['wdio'] = `wdio run ${isUsingTypescript ? 'test/wdio.conf.ts' : 'wdio.conf.js'}`
await fs.promises.writeFile(pkgJsonPath, JSON.stringify(pkgJson, null, 4))
}

Expand Down

0 comments on commit d6fd884

Please # to comment.