// Copyright IBM Corp. and LoopBack contributors 2019,2020. All Rights Reserved. // Node module: @loopback/example-express-composition // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT import {Client, expect} from '@loopback/testlab'; import {HelloObserver} from '../../observers'; import {ExpressServer} from '../../server'; import {setupExpressApplication} from './test-helper'; describe('ExpressApplication', () => { let server: ExpressServer; let client: Client; before('setupApplication', async () => { ({server, client} = await setupExpressApplication()); }); after('closes application', async () => { await server.stop(); }); it('displays front page', async () => { await client .get('/') .expect(200) .expect('Content-Type', /text\/html/); }); it('displays a static page', async () => { await client .get('/notes.html') .expect(200) .expect('Content-Type', /text\/html/) .expect(/