feat: сделать split-клиент режимом по умолчанию
- добавлен operationsTree для сборки полного клиента - удален режим генерации both - обновлена документация под npm SDK workflow - поднята версия пакета до 4.0.0
This commit is contained in:
@@ -63,7 +63,7 @@ describe('E2E Generation', () => {
|
||||
// 3. Проверка импорта (компиляция TypeScript)
|
||||
const testFile = join(tempDir, 'test-import.ts');
|
||||
const testCode = `
|
||||
import { createApiClient, HttpClient } from '${generatedFile}';
|
||||
import { createApiClient, HttpClient, operationsTree } from '${generatedFile}';
|
||||
import { getAll } from '${join(outputPath, 'operations', 'get-all.ts')}';
|
||||
|
||||
const api = createApiClient(new HttpClient(), {
|
||||
@@ -71,6 +71,8 @@ describe('E2E Generation', () => {
|
||||
getAll,
|
||||
},
|
||||
});
|
||||
const fullApi = createApiClient(new HttpClient(), operationsTree);
|
||||
fullApi.getAll;
|
||||
console.log('Import successful');
|
||||
`;
|
||||
|
||||
@@ -95,9 +97,10 @@ describe('E2E Generation', () => {
|
||||
|
||||
expect(exitCode).toBe(0);
|
||||
|
||||
const generatedFile = join(outputPath, 'MinimalAPI.ts');
|
||||
const exists = await fileExists(generatedFile);
|
||||
expect(exists).toBe(true);
|
||||
expect(await fileExists(join(outputPath, 'index.ts'))).toBe(true);
|
||||
expect(await fileExists(join(outputPath, 'http-client.ts'))).toBe(true);
|
||||
expect(await fileExists(join(outputPath, 'operations-tree.ts'))).toBe(true);
|
||||
expect(await fileExists(join(outputPath, 'operations', 'index.ts'))).toBe(true);
|
||||
}, 30000);
|
||||
|
||||
test('повторная генерация (перезапись файлов)', async () => {
|
||||
|
||||
Reference in New Issue
Block a user