Files
api-codegen/tests/helpers/fixtures.ts
2025-10-28 09:58:44 +03:00

31 lines
856 B
TypeScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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;