Skip to content

Commit 46639a0

Browse files
instantiated
1 parent ef93912 commit 46639a0

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/security-events/aws-security/aws-security.controller.spec.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
11
import { Test, TestingModule } from '@nestjs/testing';
22
import { AwsSecurityController } from './aws-security.controller';
3+
import { AwsSecurityService } from './aws-security.service';
4+
import { AwsCloudTrailService } from './aws-cloudtrail.service';
35

46
describe('AwsSecurityController', () => {
57
let controller: AwsSecurityController;
68

79
beforeEach(async () => {
810
const module: TestingModule = await Test.createTestingModule({
911
controllers: [AwsSecurityController],
12+
providers: [
13+
{ provide: AwsSecurityService, useValue: { fetchCloudTrailEvents: jest.fn(), findSecurityEvents: jest.fn() } },
14+
{ provide: AwsCloudTrailService, useValue: { getRecentSecurityEvents: jest.fn().mockResolvedValue([]) } },
15+
],
1016
}).compile();
1117

1218
controller = module.get<AwsSecurityController>(AwsSecurityController);

0 commit comments

Comments
 (0)