Skip to content

Commit

Permalink
test: test if etMatches returns all subcommand args and pos args with…
Browse files Browse the repository at this point in the history
… no rest
  • Loading branch information
Yord committed Jun 13, 2020
1 parent 275cdd5 commit 4c4ae2c
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/repl/completer/getMatches.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -233,3 +233,20 @@ test('getMatches returns all subcommand args and pos args with no rest', () => {

expect(res).toStrictEqual(exp)
})

test('getMatches returns all subcommand args and pos args with no rest', () => {
const line = 'Cat --jet A --lot'

const values = [
{...Cat, values: [
{...jet, values: ['A']},
{...lot, values: [1]}
]}
]

const res = getMatches(line, values, cmd, {only: true})

const exp = [['--jet', '--kit', '--lot', '--mad', '--nut'], line]

expect(res).toStrictEqual(exp)
})

0 comments on commit 4c4ae2c

Please sign in to comment.