const app = require('vn-loopback/server/server'); describe('updateCollectionSale()', () => { it('return a new collection', async() => { let ctx = {req: {accessToken: {userId: 106}}}; let response = await app.models.Collection.updateCollectionSale(ctx, 1, 5, 5, 5, 1, 4, false, 'UXN', 1, 1); expect(response.length).toBeGreaterThan(0); expect(response[0][0].id).toEqual(1); expect(response[0][0].quantity).toEqual(5); }); });