const app = require('../../../../item/server/server'); let ctx = {isNewInstance: true, instance: {}}; describe('Item availableId()', () => { it('should define ctx.instance.id with the expected id', async() => { let Item = app.models.Item; await Item.availableId(ctx); expect(ctx.instance.id).toEqual(6); }); });