Files
freeCodeCamp/tools/challenge-helper-scripts/helpers/get-project-meta-path.test.ts

20 lines
677 B
TypeScript
Raw Normal View History

import { getProjectMetaPath } from './get-project-meta-path';
describe('getProjectMetaPath helper', () => {
it('should throw if args are invalid', () => {
expect(() => {
getProjectMetaPath('', '');
}).toThrow();
});
it('should return the meta path', () => {
const curriculum = 'test-curriculum';
const project = 'test-project';
const expected = `${process.cwd()}/${curriculum}/challenges/_meta/${project}/meta.json`;
const expectedB = `${process.cwd()}/challenges/_meta/${project}/meta.json`;
expect(getProjectMetaPath(curriculum, project)).toEqual(expected);
expect(getProjectMetaPath('', project)).toEqual(expectedB);
});
});