Skip to content

Commit

Permalink
refactor: {} => object
Browse files Browse the repository at this point in the history
  • Loading branch information
chappelo committed Sep 1, 2024
1 parent d573d6f commit b8ec965
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions tests/unit/swagger/definitionsGeneration/definitions.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<ExtendedSpecConfig>>({}, defaultOptions, {
const optionsWithNoAdditional = Object.assign<object, ExtendedSpecConfig, Partial<ExtendedSpecConfig>>({}, defaultOptions, {
noImplicitAdditionalProperties: 'silently-remove-extras',
});
const optionsWithXEnumVarnames = Object.assign<{}, ExtendedSpecConfig, Partial<ExtendedSpecConfig>>({}, defaultOptions, {
const optionsWithXEnumVarnames = Object.assign<object, ExtendedSpecConfig, Partial<ExtendedSpecConfig>>({}, defaultOptions, {
xEnumVarnames: true,
});
interface SpecAndName {
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/swagger/parameterDetails3.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<ExtendedSpecConfig>>({}, defaultOptions, {
const optionsWithNoAdditional = Object.assign<object, ExtendedSpecConfig, Partial<ExtendedSpecConfig>>({}, defaultOptions, {
noImplicitAdditionalProperties: 'silently-remove-extras',
});

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/swagger/schemaDetails.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ describe('Schema details generation', () => {

describe('methods', () => {
describe('operationId', () => {
const optionsWithOperationIdTemplate = Object.assign<{}, ExtendedSpecConfig, Partial<ExtendedSpecConfig>>({}, getDefaultExtendedOptions(), {
const optionsWithOperationIdTemplate = Object.assign<object, ExtendedSpecConfig, Partial<ExtendedSpecConfig>>({}, getDefaultExtendedOptions(), {
operationIdTemplate: "{{replace controllerName 'Controller' ''}}_{{titleCase method.name}}",
});

Expand Down
8 changes: 4 additions & 4 deletions tests/unit/swagger/schemaDetails3.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<ExtendedSpecConfig>>({}, defaultOptions, {
const optionsWithNoAdditional = Object.assign<object, ExtendedSpecConfig, Partial<ExtendedSpecConfig>>({}, defaultOptions, {
noImplicitAdditionalProperties: 'silently-remove-extras',
});
const optionsWithXEnumVarnames = Object.assign<{}, ExtendedSpecConfig, Partial<ExtendedSpecConfig>>({}, defaultOptions, {
const optionsWithXEnumVarnames = Object.assign<object, ExtendedSpecConfig, Partial<ExtendedSpecConfig>>({}, defaultOptions, {
xEnumVarnames: true,
});
const optionsWithOperationIdTemplate = Object.assign<{}, ExtendedSpecConfig, Partial<ExtendedSpecConfig>>({}, defaultOptions, {
const optionsWithOperationIdTemplate = Object.assign<object, ExtendedSpecConfig, Partial<ExtendedSpecConfig>>({}, defaultOptions, {
operationIdTemplate: "{{replace controllerName 'Controller' ''}}_{{titleCase method.name}}",
});

Expand Down Expand Up @@ -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<object, ExtendedSpecConfig>({}, defaultOptions);
delete optionsWithNoHost.host;

const spec: Swagger.Spec3 = new SpecGenerator3(metadataGet, optionsWithNoHost).GetSpec();
Expand Down

0 comments on commit b8ec965

Please sign in to comment.