@apistudio/apim-cli
Version:
CLI for API Management Products
30 lines (26 loc) • 1.26 kB
text/typescript
/**
* Copyright IBM Corp. 2024, 2025
*/
import {AppConstants} from '../../src/constants/app.constants.js';
describe('AppConstants', () => {
it('should return parsing exception message with filename', () => {
const fileName = 'testFile';
const msg = AppConstants.PARSING_EXCEPTION(fileName);
expect(msg).toBe(`Exception occured while parsing ${fileName}.`);
})
it('should return studio-project file not found in root directory with alias', () => {
const rootDirAlias = 'testAlias';
const msg = AppConstants.ERROR_STUDIO_PROJECTS_FILE_NOT_FOUND(rootDirAlias);
expect(msg).toBe(`.apistudio-projects file not found in root directory with alias ${rootDirAlias}`);
})
it('should return error message for asset parsing', () => {
const fileName = 'testFile';
const msg = AppConstants.ERROR_ASSET_PARSING(fileName);
expect(msg).toBe(`Error in parsing file: ${fileName}`);
})
it('should return duplicate project exception message with project name', () => {
const projectName = 'testProject';
const msg = AppConstants.DUPLICATE_PROJECT_EXCEPTION(projectName);
expect(msg).toBe(`Project with name ${projectName} already exists.`);
})
});