const app = require('vn-loopback/server/server'); describe('campaign upcoming()', () => { it('should return the upcoming campaign but from the last year', async() => { const response = await app.models.Campaign.upcoming(); const campaignDated = response.dated; const now = new Date(); expect(campaignDated).toEqual(jasmine.any(Date)); expect(campaignDated).toBeLessThanOrEqual(now); }); });