I want to mock an API which has some dynamic part, so I tried to use a regular expression but it is not working.
The Id's after programs and subprograms are dynamic.
I tried to mock API by using a regular expression as below but it did not work.
const mock = RequestMock()
.onRequestTo('https://example.com/programs/.*/subprogram/.*/metrics?activeOnly=false', { method: 'GET' })
.respond(mockObject, 200, {
'access-control-allow-origin': '*'
});
Can someone please help me with this ?
Aucun commentaire:
Enregistrer un commentaire