From 8f128942730aab3fbb06c4139f1841e8bd1cf774 Mon Sep 17 00:00:00 2001 From: rakeshkumar1019 Date: Tue, 29 Oct 2024 07:32:40 +0530 Subject: [PATCH] test: release data coverage (7130) --- .../generators/__tests__/releaseData.test.mjs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/apps/site/next-data/generators/__tests__/releaseData.test.mjs b/apps/site/next-data/generators/__tests__/releaseData.test.mjs index 0cdfb5b47b0f9..5c92881e5c7a1 100644 --- a/apps/site/next-data/generators/__tests__/releaseData.test.mjs +++ b/apps/site/next-data/generators/__tests__/releaseData.test.mjs @@ -10,6 +10,15 @@ import generateReleaseData from '@/next-data/generators/releaseData.mjs'; jest.mock('@nodevu/core'); describe('generateReleaseData', () => { + beforeAll(() => { + jest.useFakeTimers(); + jest.setSystemTime(new Date('2024-10-18')); + }); + + afterAll(() => { + jest.useRealTimers(); + }); + test('generates release data with correct status', async () => { const mockNodevuOutput = { 14: { @@ -43,11 +52,11 @@ describe('generateReleaseData', () => { expect(release.version).toBe('14.0.0'); expect(release.versionWithPrefix).toBe('v14.0.0'); expect(release.codename).toBe(''); - expect(release.isLts).toBe(true); + expect(release.isLts).toBe(false); expect(release.npm).toBe('6.14.10'); expect(release.v8).toBe('8.0.276.20'); expect(release.releaseDate).toBe('2021-04-20'); expect(release.modules).toBe('83'); - expect(release.status).toBe('LTS'); + expect(release.status).toBe('End-of-life'); }); });