UNPKG

@apistudio/apim-cli

Version:

CLI for API Management Products

41 lines (35 loc) 1.33 kB
import { getBuildversion } from "../../src/functions/build-version.helper.js"; import { getBuildTime } from "../../src/functions/build-time.helper.js"; import { getProductversion } from "../../src/functions/product-version.helper.js"; jest.mock('../../src/constants/version.constants', () => ({ versionData: { majorVersion: '1', minorVersion: '2', microVersion: '3', buildVersion: '456', buildTime: '2025-01-01T12:00:00Z', } })); describe('Version Helper Function tests', () => { describe('getBuildversion', () => { it('should return the correct build version', () => { const expectedBuildVersion = '1.2.3.456'; const result = getBuildversion(); expect(result).toBe(expectedBuildVersion); }); }); describe('getProductversion', () => { it('should return the correct product version', () => { const expectedProductVersion = '1.2.3'; const result = getProductversion(); expect(result).toBe(expectedProductVersion); }); }); describe('getBuildTime', () => { it('should return the correct build time', () => { const expectedBuildTime = '2025-01-01T12:00:00Z'; const result = getBuildTime(); expect(result).toBe(expectedBuildTime); }); }); });