Skip to content

Commit

Permalink
chore: use Client instead of supertest
Browse files Browse the repository at this point in the history
Signed-off-by: Raymond Feng <enjoyjava@gmail.com>
  • Loading branch information
raymondfeng committed Sep 25, 2018
1 parent b832c39 commit 257890c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
10 changes: 4 additions & 6 deletions test/acceptance/helper.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import {ShoppingApplication} from '../..';
import {
createClientForHandler,
createRestAppClient,
givenHttpServerConfig,
supertest,
Client,
} from '@loopback/testlab';
import {RestServer} from '@loopback/rest';

export interface setupApp {
app: ShoppingApplication;
client: supertest.SuperTest<supertest.Test>;
client: Client;
}

export async function setupApplication(): Promise<setupApp> {
Expand All @@ -19,8 +18,7 @@ export async function setupApplication(): Promise<setupApp> {
await app.boot();
await app.start();

const server = await app.getServer(RestServer);
const client = createClientForHandler(server.requestHandler);
const client = createRestAppClient(app);

return {app, client};
}
1 change: 0 additions & 1 deletion test/acceptance/shopping-cart.controller.acceptance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
// License text available at https://opensource.org/licenses/MIT

import {Client, expect} from '@loopback/testlab';
import {RestServer} from '@loopback/rest';
import {ShoppingApplication} from '../..';
import {ShoppingCartRepository} from '../../src/repositories';
import {RedisDataSource} from '../../src/datasources';
Expand Down

0 comments on commit 257890c

Please sign in to comment.