Skip to content

Commit

Permalink
[feat]#79-running_Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
DaviMatheus committed Sep 2, 2024
1 parent 3adb12f commit 6a0c109
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 11 deletions.
1 change: 0 additions & 1 deletion src/content/content.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,3 @@ export class ContentController {
return result;
}
}

1 change: 0 additions & 1 deletion src/trail/trail.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import {
} from '@nestjs/common';
import { TrailService } from './trail.service';
import { UpdateTrailsDtos } from 'src/trail/dtos/updateTrailsDtos';
import mongoose from 'mongoose';

@Controller('trails')
export class TrailController {
Expand Down
2 changes: 0 additions & 2 deletions src/trail/trail.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ import { Model, Types } from 'mongoose';
import { Trail } from './trail.schema';
import { Journey } from 'src/journey/journey.schema';
import { JourneyService } from 'src/journey/journey.service';
import { query } from 'express';
import { TrailInterface } from 'src/trail/dtos/updateTrailsDtos';
import { object } from 'joi';

@Injectable()
export class TrailService {
Expand Down
4 changes: 2 additions & 2 deletions test/content.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ describe('ContentService', () => {
exec: jest.fn(),
save: jest.fn(),
create: jest.fn().mockImplementation((dto) => dto),
bulkWrite: jest.fn(),
bulkWrite: jest.fn(),
};

const mockTrailModel = {
Expand Down Expand Up @@ -178,7 +178,7 @@ describe('ContentService', () => {
describe('updateContentOrder', () => {
it('should update content order for multiple contents', async () => {
const contents: ContentInterface[] = [
{ _id: '605c72ef8c7e2a001f6e3e2e', order: 2 },
{ _id: '605c72ef8c7e2a001f6e3e2e', order: 2 },
{ _id: '605c72ef8c7e2a001f6e3e2f', order: 1 },
];
const bulkWriteResult = { acknowledged: true, modifiedCount: 2 };
Expand Down
7 changes: 2 additions & 5 deletions test/journey.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ describe('JourneyService', () => {
find: jest.fn(),
exec: jest.fn(),
create: jest.fn(),
bulkWrite: jest.fn(),
bulkWrite: jest.fn(),
};

const mockPointModel = {
Expand Down Expand Up @@ -85,7 +85,6 @@ describe('JourneyService', () => {
service.create(createJourneyDto, createJourneyDto.pointId),
).rejects.toThrow(NotFoundException);
});

});

describe('findAll', () => {
Expand Down Expand Up @@ -199,13 +198,12 @@ describe('JourneyService', () => {

describe('addTrailToJourney', () => {
describe('addTrailToJourney', () => {

it('should throw NotFoundException if journey does not exist', async () => {
mockJourneyModel.findById.mockReturnValueOnce({
exec: jest.fn().mockResolvedValue(null),
});

const invalidTrailId = new Types.ObjectId().toHexString();
const invalidTrailId = new Types.ObjectId().toHexString();

await expect(
service.addTrailToJourney('invalid-journey-id', invalidTrailId),
Expand Down Expand Up @@ -264,4 +262,3 @@ describe('JourneyService', () => {
});
});
});

0 comments on commit 6a0c109

Please sign in to comment.