const app = require('vn-loopback/server/server'); describe('message send()', () => { it('should return a response containing the same message in params', async() => { let ctx = {req: {accessToken: {userId: 1}}}; let params = { recipientFk: 1, message: 'I changed something' }; let response = await app.models.Message.send(ctx, params, {transaction: 'You'}); expect(response.message).toEqual(params.message); }); });