mardi 24 novembre 2015

How do I test wether node.js app callls a REST API?

I have a React app that is supposed to call an external api. I'd like to write a simple test that tests only wether my react component calls certain API. Something like:

it 'should call GET /external/API/', (done) ->
  expect(app).to_call.get('/external/API/').end(done)

I use superagent-mock to mock te API, but how do I simply test, that the app is calling it?

Aucun commentaire:

Enregistrer un commentaire