- Fixed unittest

This commit is contained in:
Ferdi Koomen 2022-02-25 11:55:08 +01:00
parent eedadee59e
commit a45e1b1586
4 changed files with 1290 additions and 1243 deletions

View File

@ -9,8 +9,8 @@ If you want to generate the Angular based client then you can specify `--client
The Angular client has been tested with the following versions:
```
"@angular/common": "13.1.x",
"@angular/core": "13.1.x",
"@angular/common": "13.2.x",
"@angular/core": "13.2.x",
"rxjs": "7.5.x",
```

2309
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -61,60 +61,60 @@
"dependencies": {
"camelcase": "^6.3.0",
"commander": "^9.0.0",
"handlebars": "^4.7.6",
"json-schema-ref-parser": "^9.0.7"
"handlebars": "^4.7.7",
"json-schema-ref-parser": "^9.0.9"
},
"devDependencies": {
"@angular-devkit/build-angular": "13.2.1",
"@angular/animations": "13.2.1",
"@angular/cli": "13.2.1",
"@angular/common": "13.2.1",
"@angular/compiler": "13.2.1",
"@angular/compiler-cli": "13.2.1",
"@angular/core": "13.2.1",
"@angular/forms": "13.2.1",
"@angular/platform-browser": "13.2.1",
"@angular/platform-browser-dynamic": "13.2.1",
"@angular/router": "13.2.1",
"@babel/cli": "7.16.8",
"@babel/core": "7.16.12",
"@angular-devkit/build-angular": "13.2.5",
"@angular/animations": "13.2.4",
"@angular/cli": "13.2.5",
"@angular/common": "13.2.4",
"@angular/compiler": "13.2.4",
"@angular/compiler-cli": "13.2.4",
"@angular/core": "13.2.4",
"@angular/forms": "13.2.4",
"@angular/platform-browser": "13.2.4",
"@angular/platform-browser-dynamic": "13.2.4",
"@angular/router": "13.2.4",
"@babel/cli": "7.17.6",
"@babel/core": "7.17.5",
"@babel/preset-env": "7.16.11",
"@babel/preset-typescript": "7.16.7",
"@rollup/plugin-commonjs": "21.0.1",
"@rollup/plugin-commonjs": "21.0.2",
"@rollup/plugin-node-resolve": "13.1.3",
"@rollup/plugin-typescript": "8.3.0",
"@rollup/plugin-typescript": "8.3.1",
"@types/cross-spawn": "6.0.2",
"@types/express": "4.17.13",
"@types/glob": "7.2.0",
"@types/jest": "27.4.0",
"@types/node": "17.0.14",
"@types/node-fetch": "2.5.12",
"@types/jest": "27.4.1",
"@types/node": "17.0.21",
"@types/node-fetch": "2.6.1",
"@types/qs": "6.9.7",
"@typescript-eslint/eslint-plugin": "5.10.2",
"@typescript-eslint/parser": "5.10.2",
"@typescript-eslint/eslint-plugin": "5.12.1",
"@typescript-eslint/parser": "5.12.1",
"abort-controller": "3.0.0",
"axios": "0.25.0",
"axios": "0.26.0",
"codecov": "3.8.3",
"cross-spawn": "7.0.3",
"eslint": "8.8.0",
"eslint-config-prettier": "8.3.0",
"eslint": "8.9.0",
"eslint-config-prettier": "8.4.0",
"eslint-plugin-prettier": "4.0.0",
"eslint-plugin-simple-import-sort": "7.0.0",
"express": "4.17.2",
"express": "4.17.3",
"form-data": "4.0.0",
"glob": "7.2.0",
"jest": "27.4.7",
"jest-cli": "27.4.7",
"node-fetch": "2.6.6",
"jest": "27.5.1",
"jest-cli": "27.5.1",
"node-fetch": "2.6.7",
"prettier": "2.5.1",
"puppeteer": "13.1.3",
"puppeteer": "13.4.0",
"qs": "6.10.3",
"rimraf": "3.0.2",
"rollup": "2.67.0",
"rollup-plugin-node-externals": "3.1.2",
"rollup": "2.68.0",
"rollup-plugin-node-externals": "4.0.0",
"rollup-plugin-terser": "7.0.2",
"rxjs": "7.5.2",
"ts-node": "10.4.0",
"rxjs": "7.5.4",
"ts-node": "10.5.0",
"tslib": "2.3.1",
"typescript": "4.5.5",
"zone.js": "0.11.4"

View File

@ -1,77 +1,5 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`v2 should generate: ./test/generated/v2/Demo.ts 1`] = `
"/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import { NgModule} from '@angular/core';
import { HttpClientModule } from '@angular/common/http';
import { AngularHttpRequest } from './core/AngularHttpRequest';
import { BaseHttpRequest } from './core/BaseHttpRequest';
import type { OpenAPIConfig } from './core/OpenAPI';
import { OpenAPI } from './core/OpenAPI';
import { CollectionFormatService } from './services/CollectionFormatService';
import { ComplexService } from './services/ComplexService';
import { DefaultService } from './services/DefaultService';
import { DefaultsService } from './services/DefaultsService';
import { DescriptionsService } from './services/DescriptionsService';
import { DuplicateService } from './services/DuplicateService';
import { ErrorService } from './services/ErrorService';
import { HeaderService } from './services/HeaderService';
import { MultipleTags1Service } from './services/MultipleTags1Service';
import { MultipleTags2Service } from './services/MultipleTags2Service';
import { MultipleTags3Service } from './services/MultipleTags3Service';
import { NoContentService } from './services/NoContentService';
import { ParametersService } from './services/ParametersService';
import { ResponseService } from './services/ResponseService';
import { SimpleService } from './services/SimpleService';
import { TypesService } from './services/TypesService';
@NgModule({
imports: [HttpClientModule],
providers: [
{
provide: OpenAPI,
useValue: {
BASE: OpenAPI?.BASE ?? 'http://localhost:3000/base',
VERSION: OpenAPI?.VERSION ?? '1.0',
WITH_CREDENTIALS: OpenAPI?.WITH_CREDENTIALS ?? false,
CREDENTIALS: OpenAPI?.CREDENTIALS ?? 'include',
TOKEN: OpenAPI?.TOKEN,
USERNAME: OpenAPI?.USERNAME,
PASSWORD: OpenAPI?.PASSWORD,
HEADERS: OpenAPI?.HEADERS,
ENCODE_PATH: OpenAPI?.ENCODE_PATH,
} as OpenAPIConfig,
},
{
provide: BaseHttpRequest,
useClass: AngularHttpRequest,
},
CollectionFormatService,
ComplexService,
DefaultService,
DefaultsService,
DescriptionsService,
DuplicateService,
ErrorService,
HeaderService,
MultipleTags1Service,
MultipleTags2Service,
MultipleTags3Service,
NoContentService,
ParametersService,
ResponseService,
SimpleService,
TypesService,
]
})
export class Demo {}
"
`;
exports[`v2 should generate: ./test/generated/v2/core/ApiError.ts 1`] = `
"/* istanbul ignore file */
/* tslint:disable */
@ -3023,86 +2951,6 @@ export class TypesService {
}"
`;
exports[`v3 should generate: ./test/generated/v3/Demo.ts 1`] = `
"/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import { NgModule} from '@angular/core';
import { HttpClientModule } from '@angular/common/http';
import { AngularHttpRequest } from './core/AngularHttpRequest';
import { BaseHttpRequest } from './core/BaseHttpRequest';
import type { OpenAPIConfig } from './core/OpenAPI';
import { OpenAPI } from './core/OpenAPI';
import { CollectionFormatService } from './services/CollectionFormatService';
import { ComplexService } from './services/ComplexService';
import { DefaultService } from './services/DefaultService';
import { DefaultsService } from './services/DefaultsService';
import { DescriptionsService } from './services/DescriptionsService';
import { DuplicateService } from './services/DuplicateService';
import { ErrorService } from './services/ErrorService';
import { FormDataService } from './services/FormDataService';
import { HeaderService } from './services/HeaderService';
import { MultipartService } from './services/MultipartService';
import { MultipleTags1Service } from './services/MultipleTags1Service';
import { MultipleTags2Service } from './services/MultipleTags2Service';
import { MultipleTags3Service } from './services/MultipleTags3Service';
import { NoContentService } from './services/NoContentService';
import { ParametersService } from './services/ParametersService';
import { RequestBodyService } from './services/RequestBodyService';
import { ResponseService } from './services/ResponseService';
import { SimpleService } from './services/SimpleService';
import { TypesService } from './services/TypesService';
import { UploadService } from './services/UploadService';
@NgModule({
imports: [HttpClientModule],
providers: [
{
provide: OpenAPI,
useValue: {
BASE: OpenAPI?.BASE ?? 'http://localhost:3000/base',
VERSION: OpenAPI?.VERSION ?? '1.0',
WITH_CREDENTIALS: OpenAPI?.WITH_CREDENTIALS ?? false,
CREDENTIALS: OpenAPI?.CREDENTIALS ?? 'include',
TOKEN: OpenAPI?.TOKEN,
USERNAME: OpenAPI?.USERNAME,
PASSWORD: OpenAPI?.PASSWORD,
HEADERS: OpenAPI?.HEADERS,
ENCODE_PATH: OpenAPI?.ENCODE_PATH,
} as OpenAPIConfig,
},
{
provide: BaseHttpRequest,
useClass: AngularHttpRequest,
},
CollectionFormatService,
ComplexService,
DefaultService,
DefaultsService,
DescriptionsService,
DuplicateService,
ErrorService,
FormDataService,
HeaderService,
MultipartService,
MultipleTags1Service,
MultipleTags2Service,
MultipleTags3Service,
NoContentService,
ParametersService,
RequestBodyService,
ResponseService,
SimpleService,
TypesService,
UploadService,
]
})
export class Demo {}
"
`;
exports[`v3 should generate: ./test/generated/v3/core/ApiError.ts 1`] = `
"/* istanbul ignore file */
/* tslint:disable */