Skip to content

Instantly share code, notes, and snippets.

@zahnrodolfo
zahnrodolfo / date-helper.service.spec.ts
Last active January 24, 2019 16:22
In here you have methods to add minutes, hours, days, and years to a date and the unit tests are in the spec file. No need to use external libraries. To use these service just add it to a module then call it.
import { TestBed } from '@angular/core/testing';
import { configModule } from '../../../../test/test.helper.spec';
import { DateHelperService } from './date-helper.service';
describe('Helper Service', () => {
let service: DateHelperService;
const date = new Date(Date.UTC(2019, 0, 9, 12, 25, 2));