import { AuthenticationComponent } from '@loopback/authentication' ; import { BootMixin } from '@loopback/boot' ; import { ApplicationConfig } from '@loopback/core' ; import { RepositoryMixin } from '@loopback/repository' ; import { RestApplication } from '@loopback/rest' ; import { RestExplorerComponent } from '@loopback/rest-explorer' ; import { ServiceMixin } from '@loopback/service-proxy' ; import path from 'path' ; import { JWTAuthenticationComponent , UserServiceBindings , RefreshTokenServiceBindings , } from '../../' ; import { DbDataSource } from './datasources/db.datasource' ; import { MySequence } from './sequence' ; export class TestApplication extends BootMixin ( ServiceMixin ( RepositoryMixin ( RestApplication ) ) ) { constructor ( options = { } ) { super ( options ) ; this . sequence ( MySequence ) ; this . static ( '/' , path . join ( __dirname , '../public' ) ) ; this . component ( AuthenticationComponent ) ; this . component ( JWTAuthenticationComponent ) ; this . dataSource ( DbDataSource , UserServiceBindings . DATASOURCE_NAME ) ; this . dataSource ( DbDataSource , RefreshTokenServiceBindings . DATASOURCE_NAME ) ; this . component ( RestExplorerComponent ) ; this . projectRoot = __dirname ; this . bootOptions = { controllers : { dirs : [ 'controllers' ] , extensions : [ '.controller.js' ] , nested : true , } , repositories : { dirs : [ 'repositories' ] , extensions : [ '.repository.js' ] , nested : true , } , } ; } }