Skip to content

Commit

Permalink
test: hapi, koa, openapi3 express integration rests
Browse files Browse the repository at this point in the history
  • Loading branch information
jackey8616 committed Oct 12, 2024
1 parent c310030 commit 0c8daf3
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/integration/hapi-server.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1327,6 +1327,16 @@ describe('Hapi Server', () => {
);
});

it('Should return on @Res with alias', () => {
return verifyGetRequest(
basePath + '/GetTest/Res_Alias',
(_err, res) => {
expect(res.body.name).to.equal('some_thing');
},
400,
);
});

[400, 500].forEach(statusCode =>
it('Should support multiple status codes with the same @Res structure', () => {
return verifyGetRequest(
Expand Down
10 changes: 10 additions & 0 deletions tests/integration/koa-server.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1307,6 +1307,16 @@ describe('Koa Server', () => {
);
});

it('Should return on @Res with alias', () => {
return verifyGetRequest(
basePath + '/GetTest/Res_Alias',
(_err, res) => {
expect(res.body.name).to.equal('some_thing');
},
400,
);
});

[400, 500].forEach(statusCode =>
it('Should support multiple status codes with the same @Res structure', () => {
return verifyGetRequest(
Expand Down
10 changes: 10 additions & 0 deletions tests/integration/openapi3-express.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,16 @@ describe('OpenAPI3 Express Server', () => {
);
});

it('Should return on @Res with alias', () => {
return verifyGetRequest(
basePath + '/GetTest/Res_Alias',
(_err, res) => {
expect(res.body.name).to.equal('some_thing');
},
400,
);
});

it('should valid model validate', () => {
const bodyModel = new ValidateModel();
bodyModel.floatValue = 1.2;
Expand Down

0 comments on commit 0c8daf3

Please sign in to comment.