import { expect, it } from 'vitest' import { getDiffDateInHours } from './getDiffDateInHours' it('should return a difference between dates in hours.', () => { const input1 = new Date('December 17, 1995 03:24:00') const input2 = new Date('December 18, 1995 03:24:00') const result = getDiffDateInHours(input1, input2) expect(result).toBe(24) }) it('should throw an error if non-date value is provided', () => { const input1 = null const input2 = new Date('December 18, 1995 03:24:00') const getDiffFn = () => getDiffDateInHours(input1, input2) expect(getDiffFn).toThrow() }) it('should throw an error if no value is passed into the function', () => { const resultFn = () => { getDiffDateInHours() } expect(resultFn).toThrow() })