import { createApp } from '@foal/core' ; import * as request from 'supertest' ; import { createConnection , getConnection } from 'typeorm' ; import { AppController } from '../app/app.controller' ; describe ( 'The server' , ( ) => { let app ; before ( async ( ) => { await createConnection ( ) ; app = await createApp ( AppController ) ; } ) ; after ( ( ) => getConnection ( ) . close ( ) ) ; it ( 'should return a 403 status on GET /products requests.' , ( ) => { return request ( app ) . get ( '/products' ) . expect ( 403 ) . expect ( 'Access forbidden!' ) ; } ) ; } ) ;