Тесты: часть 1
This commit is contained in:
		
							
								
								
									
										31
									
								
								tests/helpers/fixtures.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										31
									
								
								tests/helpers/fixtures.ts
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,31 @@ | ||||
| import { join } from 'path'; | ||||
| import { fileURLToPath } from 'url'; | ||||
| import { dirname } from 'path'; | ||||
|  | ||||
| const __filename = fileURLToPath(import.meta.url); | ||||
| const __dirname = dirname(__filename); | ||||
|  | ||||
| /** | ||||
|  * Путь к директории с фикстурами | ||||
|  */ | ||||
| export const FIXTURES_DIR = join(__dirname, '../fixtures'); | ||||
|  | ||||
| /** | ||||
|  * Получить путь к фикстуре | ||||
|  */ | ||||
| export function getFixturePath(name: string): string { | ||||
|   return join(FIXTURES_DIR, name); | ||||
| } | ||||
|  | ||||
| /** | ||||
|  * Доступные фикстуры | ||||
|  */ | ||||
| export const FIXTURES = { | ||||
|   MINIMAL: getFixturePath('minimal.json'), | ||||
|   VALID: getFixturePath('valid.json'), | ||||
|   COMPLEX: getFixturePath('complex.json'), | ||||
|   WITH_AUTH: getFixturePath('with-auth.json'), | ||||
|   INVALID: getFixturePath('invalid.json'), | ||||
|   EMPTY: getFixturePath('empty.json'), | ||||
|   EDGE_CASES: getFixturePath('edge-cases.json'), | ||||
| } as const; | ||||
		Reference in New Issue
	
	Block a user