Fix unit tests by mocking the date

This commit is contained in:
Samer Albahra
2019-05-19 10:37:17 -05:00
parent e28c309018
commit 9bbb41421f
3 changed files with 9 additions and 0 deletions

View File

@@ -2,6 +2,7 @@ import { expect } from 'chai';
import * as nock from 'nock';
import * as MockExpressRequest from 'mock-express-request';
import * as MockExpressResponse from 'mock-express-response';
import * as MockDate from 'mockdate';
import { getWateringData } from './weather';
@@ -11,6 +12,8 @@ const replies = require( '../test/replies.json' );
const location = '01002';
describe('Watering Data', () => {
beforeEach(() => MockDate.set('5/13/2019'));
it('OpenWeatherMap Lookup (Adjustment Method 0, Location 01002)', async () => {
mockOWM();