Skip to content

Commit

Permalink
test(): fix ts error in unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilmysliwiec committed Mar 25, 2022
1 parent bedd65b commit e552f54
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions test/explorer/swagger-explorer.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1232,7 +1232,7 @@ describe('SwaggerExplorer', () => {
const METHOD_VERSION: VersionValue = '2';
const CONTROLLER_MULTIPLE_VERSIONS: VersionValue = ['3', '4'];

@Controller({ path:'with-version', version: CONTROLLER_VERSION })
@Controller({ path: 'with-version', version: CONTROLLER_VERSION })
class WithVersionController {
@Get()
foo(): void {}
Expand All @@ -1242,7 +1242,10 @@ describe('SwaggerExplorer', () => {
bar(): void {}
}

@Controller({ path:'with-multiple-version', version: CONTROLLER_MULTIPLE_VERSIONS })
@Controller({
path: 'with-multiple-version',
version: CONTROLLER_MULTIPLE_VERSIONS
})
class WithMultipleVersionsController {
@Get()
foo(): void {}
Expand All @@ -1256,7 +1259,7 @@ describe('SwaggerExplorer', () => {
type: VersioningType.URI,
defaultVersion: 'THIS_SHOULD_NOT_APPEAR_ANYWHERE'
});
})
});

it('should use controller version defined', () => {
const routes = explorer.exploreController(
Expand Down Expand Up @@ -1302,10 +1305,14 @@ describe('SwaggerExplorer', () => {
);

expect(routes[0].root.path).toEqual(
`/globalPrefix/v${CONTROLLER_MULTIPLE_VERSIONS[0]}/modulePath/with-multiple-version`
`/globalPrefix/v${
CONTROLLER_MULTIPLE_VERSIONS[0] as string
}/modulePath/with-multiple-version`
);
expect(routes[1].root.path).toEqual(
`/globalPrefix/v${CONTROLLER_MULTIPLE_VERSIONS[1]}/modulePath/with-multiple-version`
`/globalPrefix/v${
CONTROLLER_MULTIPLE_VERSIONS[1] as string
}/modulePath/with-multiple-version`
);
});
});
Expand Down Expand Up @@ -1340,7 +1347,6 @@ describe('SwaggerExplorer', () => {
`/globalPrefix/v${DEFAULT_VERSION}/modulePath/with-multiple-version`
);
});
})

});
});
});

0 comments on commit e552f54

Please sign in to comment.