Skip to content
This repository has been archived by the owner on Apr 25, 2023. It is now read-only.

Commit

Permalink
adding test integration to lotofacil and quina
Browse files Browse the repository at this point in the history
  • Loading branch information
bruno.melo committed Apr 30, 2019
1 parent 57cfe23 commit f0770e7
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/cmd/help.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,16 @@ const menus = {
megasena: `
lottery megasena <options>
--concurso, -c .......... show contest result
`,
lotofacil: `
lottery lotofacil <options>
--concurso, -c .......... show contest result
`,
quina: `
lottery quina <options>
--concurso, -c .......... show contest result
`
}
Expand Down
18 changes: 18 additions & 0 deletions test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,24 @@ describe('Main CLI', () => {
})
})

it('should return the lotofacil option when "lottery help lotofacil"', done => {
exec(`${lottery} help lotofacil`, (err, stdout) => {
if (err) throw err
expect(stdout.includes('lottery lotofacil <options>')).to.be.true
expect(stdout.includes('--concurso, -c .......... show contest result')).to.be.true
done()
})
})

it('should return the quina option when "lottery help quina"', done => {
exec(`${lottery} help quina`, (err, stdout) => {
if (err) throw err
expect(stdout.includes('lottery quina <options>')).to.be.true
expect(stdout.includes('--concurso, -c .......... show contest result')).to.be.true
done()
})
})

it('should return the error if command doesn`t exist', done => {
exec(`${lottery} fizzbuzz`, (err, stdout) => {
if (err) throw err
Expand Down

0 comments on commit f0770e7

Please sign in to comment.