Skip to content

Commit

Permalink
add comment and modify test name
Browse files Browse the repository at this point in the history
  • Loading branch information
cdimascio committed Nov 2, 2020
1 parent 121cdc6 commit dbd519a
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions test/servers.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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));
});

Expand All @@ -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));
});

0 comments on commit dbd519a

Please sign in to comment.