import test from 'ava'

import { memoryAppender } from './test/setup'
import { createNoCommandCli, createArgv } from './test/util'

const cli = createNoCommandCli('showHelp')
test.beforeEach(() => {
  memoryAppender.logs = []
})
test('when called with no parameter', t => {
  cli.run(createArgv())
})
test('when called with -h', t => {
  cli.run(createArgv('-h'))
})
test('when called with --help', t => {
  cli.run(createArgv('--help'))
})
test('when command not found', t => {
  cli.run(createArgv('some'))
})

import test from 'ava'
import { stub, SinonStub } from 'sinon'

import { createNoCommandCli, createArgv } from './test/util'

const cli = createNoCommandCli('showVersion')
let showVersion: SinonStub
test.beforeEach(() => {
  showVersion = stub(cli, 'showVersion')
})
test.afterEach(() => {
  showVersion.restore()
})
test('with -v', t => {
  cli.run(createArgv('-v'))
  t.true(showVersion.called)
})

test('with --version', t => {
  cli.run(createArgv('--version'))
  t.true(showVersion.called)
})

Change test code back to passing state.
Change test code back to passing state.
