Skip to content

Commit

Permalink
fix: Update 'yargs' and provide command handler
Browse files Browse the repository at this point in the history
The recent update to yargs types broke command inference (see PR #35).
This can be solved by providing a handler to the command directly.
  • Loading branch information
meyfa committed Mar 19, 2023
1 parent 7a56fe7 commit ca0027f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
18 changes: 9 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@
"@meyfa/eslint-config": "3.0.0",
"@types/node": "18.15.3",
"@types/sinon": "10.0.13",
"@types/yargs": "17.0.17",
"@types/yargs": "17.0.22",
"eslint": "8.35.0",
"sinon": "15.0.1",
"typescript": "5.0.2"
},
"dependencies": {
"ts-node": "10.9.1",
"yargs": "17.6.2"
"yargs": "17.7.1"
},
"peerDependencies": {
"typescript": "^4.0.0 || ^5.0.0"
Expand Down
8 changes: 4 additions & 4 deletions src/bin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import { main } from './index.js'
import yargs from 'yargs'

const parsedArgs = yargs(process.argv.slice(2)).command('* <paths...>', 'Run tests', (yargs) => {
await yargs(process.argv.slice(2)).command('* <paths...>', 'Run tests', (yargs) => {
return yargs.options({
'test-name-pattern': {
type: 'string',
Expand Down Expand Up @@ -49,6 +49,6 @@ const parsedArgs = yargs(process.argv.slice(2)).command('* <paths...>', 'Run tes
demandOption: true,
description: 'Paths to test files'
})
}).parseSync()

await main(parsedArgs.paths, parsedArgs)
}, async (parsedArgs) => {
await main(parsedArgs.paths, parsedArgs)
}).parse()

0 comments on commit ca0027f

Please sign in to comment.