const assert = require('assert')
const Fetcher = require('../../src/models/Fetcher')
const fetchMock = require('fetch-mock')

describe('Fetcher', () => {
  describe('get', () => {
    before(() => {
      fetchMock.get('http://example.com', { foo: 'bar' })
    })

    it('returns a promise that resolves with the JSON response', done => {
      const fetcher = new Fetcher()
      fetcher.get('http://example.com').then(json => {
        assert.deepEqual({ foo: 'bar' }, json)
        fetchMock.restore()
        done()
      })
    })
  })

  describe('getStatus', () => {
    it('includes status and statusText properties', () => {
      const fakeResponse = {
        status: '404',
        statusText: 'Not Found',
      }
      const expected = '404 Not Found'
      const fetcher = new Fetcher()
      assert.equal(expected, fetcher.getStatus(fakeResponse))
    })
  })
})

@@ -414,20 +414,26 @@
 ').then(
+(%7B 
 json
+ %7D)
  =%3E %7B%0A  

Update failing Fetcher get() test