| 
									
										
										
										
											2022-01-25 11:34:16 +01:00
										 |  |  | import { getProjectMetaPath } from './get-project-meta-path'; | 
					
						
							| 
									
										
										
										
											2021-07-06 19:22:12 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  | 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); | 
					
						
							|  |  |  |   }); | 
					
						
							|  |  |  | }); |