import { Client , createRestAppClient , givenHttpServerConfig , TestSandbox , } from '@loopback/testlab' ; import path from 'path' ; import { FileUploadApplication } from '../..' ; export async function setupApplication ( fileStorageDirectory ? ) { const restConfig = givenHttpServerConfig ( { } ) ; const app = new FileUploadApplication ( { rest : restConfig , fileStorageDirectory , } ) ; await app . boot ( ) ; await app . start ( ) ; const client = createRestAppClient ( app ) ; return { app , client } ; } export interface AppWithClient { app : FileUploadApplication ; client : Client ; } export function getSandbox ( ) { const sandbox = new TestSandbox ( path . resolve ( __dirname , '../../.sandbox' ) ) ; return sandbox ; }