Skip to content

Commit ad8f216

Browse files
adding in test
1 parent 799b34f commit ad8f216

5 files changed

Lines changed: 35 additions & 5 deletions

File tree

src/reports/reports.controller.spec.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,24 @@
11
import { Test, TestingModule } from '@nestjs/testing';
22
import { ReportsController } from './reports.controller';
33
import { ReportsService } from './reports.service';
4+
import { SupabaseService } from '../supabase/supabase.service';
45

56
describe('ReportsController', () => {
67
let controller: ReportsController;
78

89
beforeEach(async () => {
910
const module: TestingModule = await Test.createTestingModule({
1011
controllers: [ReportsController],
11-
providers: [ReportsService],
12+
providers: [
13+
ReportsService,
14+
{
15+
provide: SupabaseService,
16+
useValue: {
17+
getClient: () => null,
18+
getAdminClient: () => null,
19+
},
20+
},
21+
],
1222
}).compile();
1323

1424
controller = module.get<ReportsController>(ReportsController);

src/reports/reports.controller.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { ReportsService } from './reports.service';
33
import { CreateReportDto } from './dto/create-report.dto';
44
import { UpdateReportDto } from './dto/update-report.dto';
55
import { ApiBearerAuth, ApiOkResponse, ApiSecurity } from '@nestjs/swagger';
6-
import { JwtAuthGuard } from 'src/auth/guards/jwt.auth.guard';
6+
import { JwtAuthGuard } from '../auth/guards/jwt.auth.guard';
77
import { ReportDto } from './dto/report.dto';
88

99
@ApiBearerAuth('bearerAuth')

src/reports/reports.service.spec.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,22 @@
11
import { Test, TestingModule } from '@nestjs/testing';
22
import { ReportsService } from './reports.service';
3+
import { SupabaseService } from '../supabase/supabase.service';
34

45
describe('ReportsService', () => {
56
let service: ReportsService;
67

78
beforeEach(async () => {
89
const module: TestingModule = await Test.createTestingModule({
9-
providers: [ReportsService],
10+
providers: [
11+
ReportsService,
12+
{
13+
provide: SupabaseService,
14+
useValue: {
15+
getClient: () => null,
16+
getAdminClient: () => null,
17+
},
18+
},
19+
],
1020
}).compile();
1121

1222
service = module.get<ReportsService>(ReportsService);

src/reports/reports.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Injectable, InternalServerErrorException, UnauthorizedException } from '@nestjs/common';
22
import { CreateReportDto } from './dto/create-report.dto';
33
import { UpdateReportDto } from './dto/update-report.dto';
4-
import { SupabaseService } from 'src/supabase/supabase.service';
4+
import { SupabaseService } from '../supabase/supabase.service';
55
import { ReportDto } from './dto/report.dto';
66

77
@Injectable()

src/rules/rules.service.spec.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,22 @@
11
import { Test, TestingModule } from '@nestjs/testing';
22
import { RulesService } from './rules.service';
3+
import { SupabaseService } from '../supabase/supabase.service';
34

45
describe('RulesService', () => {
56
let service: RulesService;
67

78
beforeEach(async () => {
89
const module: TestingModule = await Test.createTestingModule({
9-
providers: [RulesService],
10+
providers: [
11+
RulesService,
12+
{
13+
provide: SupabaseService,
14+
useValue: {
15+
getClient: () => null,
16+
getAdminClient: () => null,
17+
},
18+
},
19+
],
1020
}).compile();
1121

1222
service = module.get<RulesService>(RulesService);

0 commit comments

Comments
 (0)