Skip to content

Commit

Permalink
test: release data coverage (7130)
Browse files Browse the repository at this point in the history
  • Loading branch information
rakeshkumar1019 committed Oct 29, 2024
1 parent b74fef4 commit 8f12894
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions apps/site/next-data/generators/__tests__/releaseData.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down Expand Up @@ -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');
});
});

0 comments on commit 8f12894

Please sign in to comment.