diff --git a/tests/fixtures/testModel.ts b/tests/fixtures/testModel.ts index 84a9bb8df..3ccf48682 100644 --- a/tests/fixtures/testModel.ts +++ b/tests/fixtures/testModel.ts @@ -1203,7 +1203,7 @@ export class TestClassModel extends TestClassBaseModel { } type NonFunctionPropertyNames = { - [K in keyof T]: T[K] extends Function ? never : K; + [K in keyof T]: T[K] extends CallableFunction ? never : K; }[keyof T]; type NonFunctionProperties = Pick>; export class GetterClass { diff --git a/tests/unit/swagger/definitionsGeneration/definitions.spec.ts b/tests/unit/swagger/definitionsGeneration/definitions.spec.ts index da48af4cc..e4e03f092 100644 --- a/tests/unit/swagger/definitionsGeneration/definitions.spec.ts +++ b/tests/unit/swagger/definitionsGeneration/definitions.spec.ts @@ -14,10 +14,10 @@ describe('Definition generation', () => { const dynamicMetadata = new MetadataGenerator('./fixtures/controllers/getController.ts', undefined, undefined, ['./fixtures/controllers/getController.ts']).Generate(); const defaultConfig = getDefaultOptions(); const defaultOptions: ExtendedSpecConfig = { ...defaultConfig.spec, entryFile: defaultConfig.entryFile, noImplicitAdditionalProperties: 'ignore' }; - const optionsWithNoAdditional = Object.assign<{}, ExtendedSpecConfig, Partial>({}, defaultOptions, { + const optionsWithNoAdditional = Object.assign>({}, defaultOptions, { noImplicitAdditionalProperties: 'silently-remove-extras', }); - const optionsWithXEnumVarnames = Object.assign<{}, ExtendedSpecConfig, Partial>({}, defaultOptions, { + const optionsWithXEnumVarnames = Object.assign>({}, defaultOptions, { xEnumVarnames: true, }); interface SpecAndName { diff --git a/tests/unit/swagger/parameterDetails3.spec.ts b/tests/unit/swagger/parameterDetails3.spec.ts index 7ea8e7d89..0e3be3b97 100644 --- a/tests/unit/swagger/parameterDetails3.spec.ts +++ b/tests/unit/swagger/parameterDetails3.spec.ts @@ -11,7 +11,7 @@ describe('Parameter generation for OpenAPI 3.0.0', () => { const defaultConfig = getDefaultOptions(); const defaultOptions: ExtendedSpecConfig = { ...defaultConfig.spec, noImplicitAdditionalProperties: 'ignore', entryFile: defaultConfig.entryFile }; - const optionsWithNoAdditional = Object.assign<{}, ExtendedSpecConfig, Partial>({}, defaultOptions, { + const optionsWithNoAdditional = Object.assign>({}, defaultOptions, { noImplicitAdditionalProperties: 'silently-remove-extras', }); diff --git a/tests/unit/swagger/schemaDetails.spec.ts b/tests/unit/swagger/schemaDetails.spec.ts index 444966e21..3e9229a35 100644 --- a/tests/unit/swagger/schemaDetails.spec.ts +++ b/tests/unit/swagger/schemaDetails.spec.ts @@ -349,7 +349,7 @@ describe('Schema details generation', () => { describe('methods', () => { describe('operationId', () => { - const optionsWithOperationIdTemplate = Object.assign<{}, ExtendedSpecConfig, Partial>({}, getDefaultExtendedOptions(), { + const optionsWithOperationIdTemplate = Object.assign>({}, getDefaultExtendedOptions(), { operationIdTemplate: "{{replace controllerName 'Controller' ''}}_{{titleCase method.name}}", }); diff --git a/tests/unit/swagger/schemaDetails3.spec.ts b/tests/unit/swagger/schemaDetails3.spec.ts index 77bc45314..f954e6187 100644 --- a/tests/unit/swagger/schemaDetails3.spec.ts +++ b/tests/unit/swagger/schemaDetails3.spec.ts @@ -14,13 +14,13 @@ describe('Definition generation for OpenAPI 3.0.0', () => { const metadataPost = new MetadataGenerator('./fixtures/controllers/postController.ts').Generate(); const defaultOptions: ExtendedSpecConfig = getDefaultExtendedOptions(); - const optionsWithNoAdditional = Object.assign<{}, ExtendedSpecConfig, Partial>({}, defaultOptions, { + const optionsWithNoAdditional = Object.assign>({}, defaultOptions, { noImplicitAdditionalProperties: 'silently-remove-extras', }); - const optionsWithXEnumVarnames = Object.assign<{}, ExtendedSpecConfig, Partial>({}, defaultOptions, { + const optionsWithXEnumVarnames = Object.assign>({}, defaultOptions, { xEnumVarnames: true, }); - const optionsWithOperationIdTemplate = Object.assign<{}, ExtendedSpecConfig, Partial>({}, defaultOptions, { + const optionsWithOperationIdTemplate = Object.assign>({}, defaultOptions, { operationIdTemplate: "{{replace controllerName 'Controller' ''}}_{{titleCase method.name}}", }); @@ -91,7 +91,7 @@ describe('Definition generation for OpenAPI 3.0.0', () => { }); it('should have relative URL when no host is defined', () => { - const optionsWithNoHost = Object.assign<{}, ExtendedSpecConfig>({}, defaultOptions); + const optionsWithNoHost = Object.assign({}, defaultOptions); delete optionsWithNoHost.host; const spec: Swagger.Spec3 = new SpecGenerator3(metadataGet, optionsWithNoHost).GetSpec();