test refactor to async await
gitea/salix/dev This commit looks good Details

This commit is contained in:
Carlos Jimenez Ruiz 2019-03-21 08:53:12 +01:00
parent 163bf2464b
commit 6b11f26296
1 changed files with 4 additions and 6 deletions

View File

@ -1,11 +1,9 @@
const app = require('vn-loopback/server/server');
describe('client getAverageInvoiced()', () => {
it('should call the getAverageInvoiced method', done => {
app.models.Client.getAverageInvoiced(101)
.then(response => {
expect(response.invoiced).toEqual(1500);
done();
});
it('should call the getAverageInvoiced method', async() => {
const {invoiced} = await app.models.Client.getAverageInvoiced(101);
expect(invoiced).toEqual(1500);
});
});