From 0c8daf361988ffe76734a16cadbcc7f5ed87d1d7 Mon Sep 17 00:00:00 2001 From: Clooooode Date: Sat, 12 Oct 2024 12:58:31 +0800 Subject: [PATCH] test: hapi, koa, openapi3 express integration rests --- tests/integration/hapi-server.spec.ts | 10 ++++++++++ tests/integration/koa-server.spec.ts | 10 ++++++++++ tests/integration/openapi3-express.spec.ts | 10 ++++++++++ 3 files changed, 30 insertions(+) diff --git a/tests/integration/hapi-server.spec.ts b/tests/integration/hapi-server.spec.ts index 841900d55..ff4596cd2 100644 --- a/tests/integration/hapi-server.spec.ts +++ b/tests/integration/hapi-server.spec.ts @@ -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( diff --git a/tests/integration/koa-server.spec.ts b/tests/integration/koa-server.spec.ts index 3a431b3af..2d9b02c0f 100644 --- a/tests/integration/koa-server.spec.ts +++ b/tests/integration/koa-server.spec.ts @@ -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( diff --git a/tests/integration/openapi3-express.spec.ts b/tests/integration/openapi3-express.spec.ts index 0f40567c7..fb3c4ad4e 100644 --- a/tests/integration/openapi3-express.spec.ts +++ b/tests/integration/openapi3-express.spec.ts @@ -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;