diff --git a/src/misc/misc.controller.spec.ts b/src/misc/misc.controller.spec.ts index 43a3447..d8a20b1 100644 --- a/src/misc/misc.controller.spec.ts +++ b/src/misc/misc.controller.spec.ts @@ -91,7 +91,7 @@ describe('MiscController', () => { to, weekday ); - expect(result).toBe(JSON.stringify({ count }, null, 2)); + expect(result).toEqual({ count }); }); it('should use default weekday 1 if not provided', async () => { diff --git a/src/misc/misc.controller.ts b/src/misc/misc.controller.ts index a51837b..76520ba 100644 --- a/src/misc/misc.controller.ts +++ b/src/misc/misc.controller.ts @@ -93,13 +93,13 @@ export class MiscController { @Query('from') from: string, @Query('to') to: string, @Query('weekday') weekday?: string - ): Promise { + ): Promise<{ count: number }> { const count = await this.dateService.calculateWeekdays( from, to, weekday ? +weekday : 1 ); - return JSON.stringify({ count }, null, 2); + return { count }; } }