title: Jest Uncovered Lines - How do I test these lines..?
body: <p>I'm using <a href="https://facebook.github.io/jest/" rel="noreferrer">Jest</a> with the coverage option on and I'm getting:</p>
  
  <pre><code>--------------------------|----------|----------|----------|----------|----------------|
  File                      |  % Stmts | % Branch |  % Funcs |  % Lines |Uncovered Lines |
  --------------------------|----------|----------|----------|----------|----------------|
  progress-bar.js           |      100 |       75 |      100 |      100 |             17 |
  --------------------------|----------|----------|----------|----------|----------------|
  </code></pre>
  
  <p>So I have 17 uncovered lines, but I'm not sure how to cover them.</p>
  
  <p><strong>progress-bar.js</strong></p>
  
  <pre><code>import ProgressBar from 'progress'
  import isNumber from 'lodash/isNumber'
  import config from '../../config/global'
  
  function progressBar (total) {
    if (!isNumber(total)) throw new Error(`progressBar() 'total' arg is not a number.`)
  
    const barCfg = config.progressBar
  
    const tokens = `${barCfg.bar} ${barCfg.info}`
  
    const options = {
      width: barCfg.width,
      total: total || 1,
      complete: barCfg.complete,
      incomplete: barCfg.incomplete
    }
  
    const bar = new ProgressBar(tokens, options)
  
    bar.render()
  
    return bar
  }
  
  export default progressBar
  </code></pre>
  
  <p><strong>progress-bar.test.js</strong></p>
  
  <pre><code>import ProgressBar from 'progress'
  import progressBar from './progress-bar'
  
  describe('progressBar()', () =&gt; {
    test('returns instanceof ProgressBar', () =&gt; {
      const actual = progressBar(5) instanceof ProgressBar
      const expected = true
      expect(actual).toBe(expected)
    })
  
    test('throw error if arg "total" is not a number', () =&gt; {
      expect(() =&gt; { progressBar('moo') }).toThrow()
      expect(() =&gt; { progressBar(null) }).toThrow()
    })
  
    test('progress bar progress/ticking', () =&gt; {
      const bar = progressBar(5)
      expect(bar.total).toBe(5)
      expect(bar.curr).toBe(0)
      bar.tick()
      expect(bar.curr).toBe(1)
      bar.tick()
      expect(bar.curr).toBe(2)
      bar.tick()
      expect(bar.curr).toBe(3)
      bar.tick()
      expect(bar.curr).toBe(4)
      bar.tick()
      expect(bar.curr).toBe(5)
      expect(bar.complete).toBe(true)
    })
  })
  </code></pre>
  
  <p>So I'm testing the argument and return values.</p>
  
  <p>How do I fully test this function, including the 17 lines..? </p>