mercredi 10 juin 2020

Can I change the headers in a Testcafe mock?

I'm currently having an issue where the "x-hammerhead-credentials" header of my mocks is causing a 222 error, despite not adding it myself. If I remove it manually, then the request passes - but I want to be able to do this in the tests.

Is it possible to remove this header from the request (or at the very least change the value?)

  Before('@freeVideo', async (t) => {
    videoMock = RequestMock()
        .onRequestTo({ url: /videos/, method: 'GET'})
        .respond(FreeVideo, 200, {'access-control-allow-origin': '*'});
    await t.addRequestHooks(videoMock);
  })

Aucun commentaire:

Enregistrer un commentaire