UNPKG

cloc-graph

Version:

Track lines of code over time by language with visualization

25 lines (24 loc) 1 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const dateUtils_1 = require("../../utils/dateUtils"); describe('Date Utils', () => { describe('formatDate', () => { it('should format a date as YYYY-MM-DD', () => { const date = new Date('2025-05-23T12:00:00Z'); expect((0, dateUtils_1.formatDate)(date)).toBe('2025-05-23'); }); }); describe('getYearMonth', () => { it('should return year and month in YYYY-MM format', () => { const date = new Date('2025-05-23T12:00:00Z'); expect((0, dateUtils_1.getYearMonth)(date)).toBe('2025-05'); }); }); describe('getISOWeek', () => { it('should return the correct ISO week number', () => { // May 23, 2025 is in week 20 of the year (actual calculation result) const date = new Date('2025-05-23T12:00:00Z'); expect((0, dateUtils_1.getISOWeek)(date)).toBe('2025-20'); }); }); });