From 0494089cb98ef3b5df54f062540185a8a882bfa3 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Tue, 6 Aug 2024 17:20:20 +0000 Subject: [PATCH 1/3] chore(release): 1.1.0 [skip-ci] --- CHANGELOG.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d2bb584..89b80a5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,19 @@ +# [1.1.0](https://github.com/GuningShen/treetracker-like/compare/v1.0.0...v1.1.0) (2024-08-06) + + +### Bug Fixes + +* cmd [skip-ci] ([5fbfaea](https://github.com/GuningShen/treetracker-like/commit/5fbfaea800448a7bb819c2ba5fa6ce336ab0383f)) +* rm branch [skip-ci] ([64cd0d9](https://github.com/GuningShen/treetracker-like/commit/64cd0d9ea55a216e8c98bf8725f8a5e2dd0e2a4f)) +* run test on pr creation skip-ci ([e0495d4](https://github.com/GuningShen/treetracker-like/commit/e0495d40d0cbbb9836dc4da7e2ee88b1ac823606)) +* use yarn instead of npm [ski-ci] ([6b22f17](https://github.com/GuningShen/treetracker-like/commit/6b22f17a9fbec14038b35a670542f473bebed6ec)) + + +### Features + +* add semantic versiining [skip-ci] ([2ff8a85](https://github.com/GuningShen/treetracker-like/commit/2ff8a85db2e243d5fac58db97fa42a7ebcfdec7c)) +* migrate from nx to yarn ([0179a49](https://github.com/GuningShen/treetracker-like/commit/0179a49aa0460eb3f1d7074069a804f7518ef703)) + ## [1.3.1](https://github.com/Greenstand/treetracker-like/compare/v1.3.0...v1.3.1) (2024-07-31) From 9f4b34236e65d78b42b90f2b37bc4996d673056e Mon Sep 17 00:00:00 2001 From: Guning Shen Date: Tue, 6 Aug 2024 16:12:33 -0400 Subject: [PATCH 2/3] refactor: add integration test --- apps/like/__test__/object.spec.ts | 1 + apps/like/__test__/type.spec.ts | 1 + apps/like/__test__/user.spec.ts | 1 + 3 files changed, 3 insertions(+) create mode 100644 apps/like/__test__/object.spec.ts create mode 100644 apps/like/__test__/type.spec.ts create mode 100644 apps/like/__test__/user.spec.ts diff --git a/apps/like/__test__/object.spec.ts b/apps/like/__test__/object.spec.ts new file mode 100644 index 0000000..8ea67f7 --- /dev/null +++ b/apps/like/__test__/object.spec.ts @@ -0,0 +1 @@ +// Integration test for the object \ No newline at end of file diff --git a/apps/like/__test__/type.spec.ts b/apps/like/__test__/type.spec.ts new file mode 100644 index 0000000..f97a9b3 --- /dev/null +++ b/apps/like/__test__/type.spec.ts @@ -0,0 +1 @@ +// Integration test for the like type \ No newline at end of file diff --git a/apps/like/__test__/user.spec.ts b/apps/like/__test__/user.spec.ts new file mode 100644 index 0000000..714a046 --- /dev/null +++ b/apps/like/__test__/user.spec.ts @@ -0,0 +1 @@ +// Integration test for user \ No newline at end of file From 6dbe3ad7541d7e412e42f8cad23a84963c55f608 Mon Sep 17 00:00:00 2001 From: Guning Shen Date: Tue, 6 Aug 2024 16:16:54 -0400 Subject: [PATCH 3/3] refactor: add unit tests --- apps/like/__test__/object.spec.ts | 2 +- apps/like/__test__/type.spec.ts | 2 +- apps/like/__test__/user.spec.ts | 2 +- .../like/src/object/object.controller.spec.ts | 59 +++++++++++++++++++ apps/like/src/type/type.controller.spec.ts | 1 + apps/like/src/user/user.controller.spec.ts | 1 + 6 files changed, 64 insertions(+), 3 deletions(-) create mode 100644 apps/like/src/object/object.controller.spec.ts create mode 100644 apps/like/src/type/type.controller.spec.ts create mode 100644 apps/like/src/user/user.controller.spec.ts diff --git a/apps/like/__test__/object.spec.ts b/apps/like/__test__/object.spec.ts index 8ea67f7..772c54a 100644 --- a/apps/like/__test__/object.spec.ts +++ b/apps/like/__test__/object.spec.ts @@ -1 +1 @@ -// Integration test for the object \ No newline at end of file +// This file contains integration tests for the Object Module. \ No newline at end of file diff --git a/apps/like/__test__/type.spec.ts b/apps/like/__test__/type.spec.ts index f97a9b3..76704fe 100644 --- a/apps/like/__test__/type.spec.ts +++ b/apps/like/__test__/type.spec.ts @@ -1 +1 @@ -// Integration test for the like type \ No newline at end of file +// This file contains integration tests for the Type module. \ No newline at end of file diff --git a/apps/like/__test__/user.spec.ts b/apps/like/__test__/user.spec.ts index 714a046..698bd16 100644 --- a/apps/like/__test__/user.spec.ts +++ b/apps/like/__test__/user.spec.ts @@ -1 +1 @@ -// Integration test for user \ No newline at end of file +// This file contains integration tests for the User Module. diff --git a/apps/like/src/object/object.controller.spec.ts b/apps/like/src/object/object.controller.spec.ts new file mode 100644 index 0000000..85b071c --- /dev/null +++ b/apps/like/src/object/object.controller.spec.ts @@ -0,0 +1,59 @@ +// This file contains the unit tests of the ObjectController class. + +import { Test, TestingModule } from '@nestjs/testing'; +import { ObjectController } from './object.controller'; +import { ObjectService } from './object.service'; + +// describe('ObjectController', () => { +// let controller: ObjectController; +// let service: ObjectService; + +// beforeEach(async () => { +// const module: TestingModule = await Test.createTestingModule({ +// controllers: [ObjectController], +// providers: [ObjectService], +// }).compile(); + +// controller = module.get(ObjectController); +// service = module.get(ObjectService); +// }); + +// describe('handleGetObjectLikes', () => { +// it('should call the service method to get object likes', async () => { +// const type_id = '1'; +// const object_id = '2'; + +// const serviceSpy = jest.spyOn(service, 'getObjectLikes'); + +// await controller.handleGetObjectLikes(type_id, object_id); + +// expect(serviceSpy).toHaveBeenCalledWith(type_id, object_id); +// }); +// }); + +// describe('handleLikeObject', () => { +// it('should call the service method to like an object', async () => { +// const type_id = '1'; +// const object_id = '2'; + +// const serviceSpy = jest.spyOn(service, 'likeObject'); + +// await controller.handleLikeObject(type_id, object_id); + +// expect(serviceSpy).toHaveBeenCalledWith(type_id, object_id); +// }); +// }); + +// describe('handleUnlikeObject', () => { +// it('should call the service method to unlike an object', async () => { +// const type_id = '1'; +// const object_id = '2'; + +// const serviceSpy = jest.spyOn(service, 'unlikeObject'); + +// await controller.handleUnlikeObject(type_id, object_id); + +// expect(serviceSpy).toHaveBeenCalledWith(type_id, object_id); +// }); +// }); +// }); \ No newline at end of file diff --git a/apps/like/src/type/type.controller.spec.ts b/apps/like/src/type/type.controller.spec.ts new file mode 100644 index 0000000..6123bd1 --- /dev/null +++ b/apps/like/src/type/type.controller.spec.ts @@ -0,0 +1 @@ +// This file contains unit tests for the TypeController class. \ No newline at end of file diff --git a/apps/like/src/user/user.controller.spec.ts b/apps/like/src/user/user.controller.spec.ts new file mode 100644 index 0000000..4e657cb --- /dev/null +++ b/apps/like/src/user/user.controller.spec.ts @@ -0,0 +1 @@ +// This file contains the unit tests for the UserController class. \ No newline at end of file