dimanche 5 juin 2016

nock is not intercepting my request

I'm trying to create some basic tests using karma server and nock. It seems like nock is not intercepting my requests at all, does anyone have idea? I can't figure out what is missing. I still getting real data.

nock('http://ift.tt/1gcW4Wp' + username).log(console.log)
.get('/')
.query(true)
.reply(400, {
  statusMessage: 'Bad Request',
  foo: 'foo'
})

http.get('http://ift.tt/1gcW4Wp' + username, function(res) {
  console.log('res', res)
})

I also added this middleware

const middlewares = [thunk];
const mockStore = configureStore(middlewares);

Aucun commentaire:

Enregistrer un commentaire