mirror of
https://github.com/ferdikoomen/openapi-typescript-codegen.git
synced 2025-12-08 20:16:21 +00:00
28 lines
748 B
TypeScript
28 lines
748 B
TypeScript
import { Service } from '../client/interfaces/Service';
|
|
import { getServiceNames } from './getServiceNames';
|
|
|
|
describe('getServiceNames', () => {
|
|
it('should return sorted list', () => {
|
|
const john: Service = {
|
|
name: 'John',
|
|
operations: [],
|
|
imports: [],
|
|
};
|
|
const jane: Service = {
|
|
name: 'Jane',
|
|
operations: [],
|
|
imports: [],
|
|
};
|
|
const doe: Service = {
|
|
name: 'Doe',
|
|
operations: [],
|
|
imports: [],
|
|
};
|
|
|
|
const services: Service[] = [john, jane, doe];
|
|
|
|
expect(getServiceNames([])).toEqual([]);
|
|
expect(getServiceNames(services)).toEqual(['Doe', 'Jane', 'John']);
|
|
});
|
|
});
|