const models = require('vn-loopback/server/server').models; describe('agency getLanded()', () => { it('should return a landing date', async() => { const ctx = {req: {accessToken: {userId: 1}}}; const shipped = new Date(); shipped.setDate(shipped.getDate() + 1); const addressFk = 121; const agencyModeFk = 7; const warehouseFk = 1; const tx = await models.Zone.beginTransaction({}); try { const options = {transaction: tx}; const result = await models.Agency.getLanded(ctx, shipped, addressFk, agencyModeFk, warehouseFk, options); expect(result.landed).toBeDefined(); await tx.rollback(); } catch (e) { await tx.rollback(); throw e; } }); });