import { format, getDaysInMonth, getMonth, getYear, isValid, parse } from "date-fns";
export class DateService {
public getDaysInMonth(month?: Date) {
return getDaysInMonth(month || new Date());
}
How do I test it? How can I access the function implementation?
2
Answers
import the class:
setup your describe block and instantiate the DateService
And then test results: