Я новичок в JavaScript и мокко.Учитывая следующий код:
const emailClothingOfferStatus = emailClothing => {
let withEmailClothing = {}
const emailClothingRegex = 'hello';
if(emailClothing){
withEmailClothing = {validPermStatus: emailClothing}
}
return request
.get(`${API_ENDPOINT}/provider`)
.query(withEmailClothing)
.then(
res => {
if (res.body.validPermStatus.match(emailClothingRegex)) {
return {
clothingStatus: (res.body.validPermStatus)
}
//try/catch block here
Когда я звоню с
const response = emailClothingOfferStatus(clothingStatus);
return expect(response).to.eventually.equal('hello')
могу ли я получить результат:
AssertionError: expected { clothingStatus: 'hello' } to equal 'hello'