mirror of
https://github.com/nestjs/nest.git
synced 2026-02-21 23:11:44 +00:00
test(06-mongoose): add missing tests for controller
This commit is contained in:
@@ -7,6 +7,8 @@ import { Types } from 'mongoose';
|
||||
const catsServiceMock = {
|
||||
create: jest.fn(),
|
||||
findAll: jest.fn(),
|
||||
findOne: jest.fn(),
|
||||
delete: jest.fn(),
|
||||
};
|
||||
|
||||
describe('Cats Controller', () => {
|
||||
|
||||
@@ -21,7 +21,7 @@ export class CatsService {
|
||||
return this.catModel.findOne({ _id: id }).exec();
|
||||
}
|
||||
|
||||
async delete(id: string) {
|
||||
async delete(id: string): Promise<Cat> {
|
||||
const deletedCat = await this.catModel
|
||||
.findByIdAndRemove({ _id: id })
|
||||
.exec();
|
||||
|
||||
Reference in New Issue
Block a user