Heera Singh
08/08/2022, 11:54 AM200
status and it worked well for me, my next task is to validate 401 Unauthorised
state, but my consumer test is failing https://codeshare.io/wnEOZD, could anyone point me to right direction.Yousaf Nabi (pactflow.io)
Yousaf Nabi (pactflow.io)
Heera Singh
08/08/2022, 11:57 AMRequest failed with status code 401
Yousaf Nabi (pactflow.io)
Heera Singh
08/08/2022, 12:00 PM401
but does not match the bodyHeera Singh
08/08/2022, 12:01 PMasync getUserSettingsStatus() {
return axios
.get(this.withPath("/api/1/user"), {
headers: authHeader,
})
.then((r) => {
return r.data;
});
}
Timothy Jones
08/08/2022, 12:07 PMHeera Singh
08/08/2022, 1:15 PMHeera Singh
08/08/2022, 1:15 PMasync getUserSettingsStatus() {
return axios
.get(this.withPath("/api/1/user"), {
headers: authHeader,
})
.then((r) => {
return r.data;
})
.catch((error) => {
if (error.response.status === 401) {
return Promise.resolve(error.response.data);
}
});
}
Timothy Jones
08/08/2022, 2:32 PMHeera Singh
08/08/2022, 2:40 PMMatt (pactflow.io / pact-js / pact-go)