getModelCustomers(modelName) {
const promise = new Promise((resolve, reject) => {
this.getCustomers(modelName)
.toPromise()
.then(
res => {
this.assetModel.addModelCustomers(res);
this.customers = {
data: this.getFormattedCustomers(this.assetModel.customers)
};
this.customersList.push(this.getFormattedCustomers(this.assetModel.customers));
resolve(this.assetModel.customers);
},
rej => {
reject(rej);
}
);
});
return promise;
}
I'm not sure how to write a test case for this code. Any help would be appreciated I'm stuck with the same