const models = require('vn-loopback/server/server').models; describe('department getLeaves()', () => { it('should return the department and the childs containing the search value', async() => { const tx = await models.Zone.beginTransaction({}); try { let result = await models.Zone.getLeaves(null, '31'); expect(result.length).toEqual(1); await tx.rollback(); } catch (e) { await tx.rollback(); throw e; } }); });