Reputation: 495
Is it possible to mock the Date returned from this service so that it can reflect different timezones in a Jasmine/Karma context? I'm not looking to simplify modify the hours/minutes to reflect UTC, the offset will be modified too. The mock object will behave as if new Date() was created from a browser in that timezone.
export class TimeService {
static getCurrentDate(): Date {
return new Date();
}
}
Upvotes: 0
Views: 37