Skip to content

Commit

Permalink
feat: add openapi unittest
Browse files Browse the repository at this point in the history
  • Loading branch information
deleonio committed Dec 1, 2020
1 parent 5333d84 commit 87e69fd
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,33 @@
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 1.0.0
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/

import { Observable } from 'rxjs';

import { IVersion } from '../models';
import { BaseAPI } from '../runtime';
import {
IVersion,
} from '../models';

/**
* no description
*/
export class VersionApi extends BaseAPI {
/**
* Liefert die aktuelle Version des Webservices.
* Versionsnummer
*/
versionGet = (): Observable<IVersion> => {
return this.request<IVersion>({
path: '/version',
method: 'GET',
});
};

/**
* Liefert die aktuelle Version des Webservices.
* Versionsnummer
*/
versionGet = (): Observable<IVersion> => {
return this.request<IVersion>({
path: '/version',
method: 'GET',
});
};

}
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,22 @@ export interface IVersion {
* @memberof IVersion
*/
text: string;
/**
* @type {string}
* @memberof IVersion
*/
label?: IVersionLabelEnum;
}

/**
* @export
* @enum {string}
*/
export enum IVersionLabelEnum {
Latest = 'latest',
Next = 'next',
Rc = 'rc',
Beta = 'beta',
Alpha = 'alpha'
}

2 changes: 1 addition & 1 deletion packages/cli/core/template/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@
"removeComments": true,
"strict": true
},
"include": ["src/**/*", "tests/**/*", "node_modules/@leanup/**/*"],
"include": ["openapi/**/*", "src/**/*", "tests/**/*", "node_modules/@leanup/**/*"],
"exclude": ["node_modules/@leanup/**/template/**/*"]
}
18 changes: 18 additions & 0 deletions packages/cli/core/test/template/tests/unit/openapi.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { expect } from 'chai';

import { IVersion, IVersionLabelEnum } from '../../openapi/typescript-rxjs';

describe(`Test: OpenAPI`, () => {
const label: IVersionLabelEnum = IVersionLabelEnum.Latest;
const version: IVersion = {
major: 1,
minor: 2,
patch: 3,
text: '1.2.3',
label: label,
};

it('Test Version', () => {
expect(version.text).be.equal('1.2.3');
});
});

0 comments on commit 87e69fd

Please sign in to comment.