From dbd519a87f554dc368120e9de7451fa131744bad Mon Sep 17 00:00:00 2001 From: Carmine DiMascio Date: Sun, 1 Nov 2020 22:59:16 -0500 Subject: [PATCH] add comment and modify test name --- test/servers.spec.ts | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/test/servers.spec.ts b/test/servers.spec.ts index 43d9b613..ed229c29 100644 --- a/test/servers.spec.ts +++ b/test/servers.spec.ts @@ -24,13 +24,16 @@ describe(packageJson.name, () => { after(() => app.server.close()); - it('should validate server path with version variable, v2', async () => + it('should validate server path with version variable, v2 and petstore', async () => request(app).get('/api/v1/petstore/ping').query({}).expect(400)); - it('should validate server path with version variable, v2', async () => + it('should validate server path with version variable, v2 and storeofpets', async () => request(app).get('/api/v2/storeofpets/ping').send({}).expect(400)); - it('should skip validation of api path with undeclared variable value', async () => + it('should skip validation of api path with invalid enum value v3, and valid value petstore', async () => + // the validator should not validate routes that do note match one declare in the opeanpi apec + // in this case, 'v3' is not a valid value for api + // TODO throw an error instead of ignoring it request(app).get('/api/v3/petstore/ping').send({}).expect(200)); }); @@ -55,13 +58,16 @@ describe(packageJson.name, () => { after(() => app.server.close()); - it('should validate server path with version variable, v2', async () => + it('should validate server path with version variables, v2 and petstore', async () => request(app).get('/api/v1:petstore/ping').query({}).expect(400)); - it('should validate server path with version variable, v2', async () => + it('should validate server path with version variables, v2 and storeofpets', async () => request(app).get('/api/v2:storeofpets/ping').send({}).expect(400)); - it('should skip validation of api path with undeclared variable value', async () => + it('should skip validation of api path with invalid variable value, v2, and valid variable petstore', async () => + // the validator should not validate routes that do note match one declare in the opeanpi apec + // in this case, 'v3' is not a valid value for api + // TODO throw an error instead of ignoring it request(app).get('/api/v3:petstore/ping').send({}).expect(200)); }); \ No newline at end of file