mirror of
https://github.com/ferdikoomen/openapi-typescript-codegen.git
synced 2025-12-08 20:16:21 +00:00
31 lines
879 B
TypeScript
31 lines
879 B
TypeScript
import { Service } from '../client/interfaces/Service';
|
|
import { writeFile } from './fileSystem';
|
|
import { Templates } from './registerHandlebarsTemplates';
|
|
import { writeClientServices } from './writeClientServices';
|
|
|
|
jest.mock('./fileSystem');
|
|
|
|
describe('writeClientServices', () => {
|
|
it('should write to filesystem', async () => {
|
|
const services: Service[] = [
|
|
{
|
|
name: 'Item',
|
|
operations: [],
|
|
imports: [],
|
|
},
|
|
];
|
|
|
|
const templates: Templates = {
|
|
index: () => 'dummy',
|
|
model: () => 'dummy',
|
|
schema: () => 'dummy',
|
|
service: () => 'dummy',
|
|
settings: () => 'dummy',
|
|
};
|
|
|
|
await writeClientServices(services, templates, '/', false);
|
|
|
|
expect(writeFile).toBeCalledWith('/Item.ts', 'dummy');
|
|
});
|
|
});
|