Skip to content

Commit

Permalink
test: openapispec
Browse files Browse the repository at this point in the history
  • Loading branch information
nabdelgadir committed Apr 15, 2019
1 parent 74850d5 commit 386f9c1
Showing 1 changed file with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,28 @@ describe('booter-lb3app', () => {
});
});

context('open API spec endpoints', () => {
it('includes LoopBack 4 endpoints in OpenApiSpec', () => {
const apiSpec = app.restServer.getApiSpec();
const paths = Object.keys(apiSpec.paths);
expect(paths).to.containDeep([
'/coffees',
'/coffees/count',
'/coffees/{id}',
]);
});

it('includes LoopBack 3 endpoints with `/api` base in OpenApiSpec', () => {
const apiSpec = app.restServer.getApiSpec();
const paths = Object.keys(apiSpec.paths);
expect(paths).to.containDeep([
'/api/CoffeeShops/{id}',
'/api/CoffeeShops',
'/api/CoffeeShops/count',
]);
});
});

context('mounting routes only of LoopBack 3 application', () => {
before(async () => {
({app, client} = await setupApplication({
Expand Down

0 comments on commit 386f9c1

Please sign in to comment.