@@ -4,13 +4,19 @@ import { ConfigModule } from '@nestjs/config';
44import { JwtModule } from '@nestjs/jwt' ;
55import { ReportsService } from './reports/reports.service' ;
66import { vi , describe , it , expect } from 'vitest' ;
7+ import configuration from './config/configuration' ;
8+ import { PerplexityService } from './services/perplexity.service' ;
9+ import { AwsSecretsService } from './services/aws-secrets.service' ;
10+ import { AwsTextractService } from './document-processor/services/aws-textract.service' ;
11+ import { AwsBedrockService } from './document-processor/services/aws-bedrock.service' ;
712
813describe ( 'AppModule' , ( ) => {
914 it ( 'should compile the module' , async ( ) => {
1015 const module = await Test . createTestingModule ( {
1116 imports : [
1217 ConfigModule . forRoot ( {
1318 isGlobal : true ,
19+ load : [ configuration ] ,
1420 } ) ,
1521 JwtModule . register ( {
1622 secret : 'test-secret' ,
@@ -26,6 +32,33 @@ describe('AppModule', () => {
2632 findOne : vi . fn ( ) . mockResolvedValue ( { } ) ,
2733 updateStatus : vi . fn ( ) . mockResolvedValue ( { } ) ,
2834 } )
35+ . overrideProvider ( PerplexityService )
36+ . useValue ( {
37+ askQuestion : vi . fn ( ) . mockResolvedValue ( { } ) ,
38+ } )
39+ . overrideProvider ( AwsSecretsService )
40+ . useValue ( {
41+ getPerplexityApiKey : vi . fn ( ) . mockResolvedValue ( 'test-api-key' ) ,
42+ } )
43+ . overrideProvider ( AwsTextractService )
44+ . useValue ( {
45+ extractText : vi . fn ( ) . mockResolvedValue ( { } ) ,
46+ processBatch : vi . fn ( ) . mockResolvedValue ( [ ] ) ,
47+ } )
48+ . overrideProvider ( AwsBedrockService )
49+ . useValue ( {
50+ generateResponse : vi . fn ( ) . mockResolvedValue ( 'test response' ) ,
51+ analyzeMedicalDocument : vi . fn ( ) . mockResolvedValue ( {
52+ keyMedicalTerms : [ ] ,
53+ labValues : [ ] ,
54+ diagnoses : [ ] ,
55+ metadata : {
56+ isMedicalReport : true ,
57+ confidence : 0.9 ,
58+ missingInformation : [ ] ,
59+ } ,
60+ } ) ,
61+ } )
2962 . compile ( ) ;
3063
3164 expect ( module ) . toBeDefined ( ) ;
0 commit comments