Skip to content

Commit b6183e0

Browse files
committed
feat: update the unit testing
1 parent de64e74 commit b6183e0

3 files changed

Lines changed: 44 additions & 41 deletions

File tree

jest-stare/index.html

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ <h2>Snapshots</h2>
154154
&quot;unmatched&quot;: 0,
155155
&quot;updated&quot;: 0
156156
},
157-
&quot;startTime&quot;: 1747846429942,
157+
&quot;startTime&quot;: 1748358209653,
158158
&quot;success&quot;: false,
159159
&quot;testResults&quot;: [
160160
{
@@ -165,10 +165,10 @@ <h2>Snapshots</h2>
165165
&quot;numTodoTests&quot;: 0,
166166
&quot;openHandles&quot;: [],
167167
&quot;perfStats&quot;: {
168-
&quot;end&quot;: 1747846435233,
169-
&quot;runtime&quot;: 4662,
170-
&quot;slow&quot;: false,
171-
&quot;start&quot;: 1747846430571
168+
&quot;end&quot;: 1748358215417,
169+
&quot;runtime&quot;: 5113,
170+
&quot;slow&quot;: true,
171+
&quot;start&quot;: 1748358210304
172172
},
173173
&quot;skipped&quot;: false,
174174
&quot;snapshot&quot;: {
@@ -180,14 +180,14 @@ <h2>Snapshots</h2>
180180
&quot;unmatched&quot;: 0,
181181
&quot;updated&quot;: 0
182182
},
183-
&quot;testFilePath&quot;: &quot;D:\\Github_profile\\SmartEduHub-Repo\\NotifyLog\\src\\notification\\presentation\\controllers\\log.controller.spec.ts&quot;,
183+
&quot;testFilePath&quot;: &quot;D:\\Github_profile\\SmartEduHub-Repo\\NotifyLog\\test\\logger\\log.controller.spec.ts&quot;,
184184
&quot;testResults&quot;: [
185185
{
186186
&quot;ancestorTitles&quot;: [
187187
&quot;LogController&quot;,
188188
&quot;getLogs&quot;
189189
],
190-
&quot;duration&quot;: 35,
190+
&quot;duration&quot;: 19,
191191
&quot;failureDetails&quot;: [],
192192
&quot;failureMessages&quot;: [],
193193
&quot;fullName&quot;: &quot;LogController getLogs should return logs with default pagination&quot;,
@@ -203,7 +203,7 @@ <h2>Snapshots</h2>
203203
&quot;LogController&quot;,
204204
&quot;getLogById&quot;
205205
],
206-
&quot;duration&quot;: 3,
206+
&quot;duration&quot;: 2,
207207
&quot;failureDetails&quot;: [],
208208
&quot;failureMessages&quot;: [],
209209
&quot;fullName&quot;: &quot;LogController getLogById should return a log by ID&quot;,
@@ -219,7 +219,7 @@ <h2>Snapshots</h2>
219219
&quot;LogController&quot;,
220220
&quot;getLogById&quot;
221221
],
222-
&quot;duration&quot;: 12,
222+
&quot;duration&quot;: 13,
223223
&quot;failureDetails&quot;: [],
224224
&quot;failureMessages&quot;: [],
225225
&quot;fullName&quot;: &quot;LogController getLogById should throw NotFoundException if log not found&quot;,
@@ -235,7 +235,7 @@ <h2>Snapshots</h2>
235235
&quot;LogController&quot;,
236236
&quot;deleteLogById&quot;
237237
],
238-
&quot;duration&quot;: 1,
238+
&quot;duration&quot;: 2,
239239
&quot;failureDetails&quot;: [],
240240
&quot;failureMessages&quot;: [],
241241
&quot;fullName&quot;: &quot;LogController deleteLogById should delete a log by ID&quot;,
@@ -267,7 +267,7 @@ <h2>Snapshots</h2>
267267
&quot;LogController&quot;,
268268
&quot;getLogStats&quot;
269269
],
270-
&quot;duration&quot;: 2,
270+
&quot;duration&quot;: 4,
271271
&quot;failureDetails&quot;: [],
272272
&quot;failureMessages&quot;: [],
273273
&quot;fullName&quot;: &quot;LogController getLogStats should return log statistics&quot;,
@@ -305,10 +305,10 @@ <h2>Snapshots</h2>
305305
&quot;numTodoTests&quot;: 0,
306306
&quot;openHandles&quot;: [],
307307
&quot;perfStats&quot;: {
308-
&quot;end&quot;: 1747846435444,
309-
&quot;runtime&quot;: 4875,
310-
&quot;slow&quot;: false,
311-
&quot;start&quot;: 1747846430569
308+
&quot;end&quot;: 1748358215656,
309+
&quot;runtime&quot;: 5359,
310+
&quot;slow&quot;: true,
311+
&quot;start&quot;: 1748358210297
312312
},
313313
&quot;skipped&quot;: false,
314314
&quot;snapshot&quot;: {
@@ -320,14 +320,14 @@ <h2>Snapshots</h2>
320320
&quot;unmatched&quot;: 0,
321321
&quot;updated&quot;: 0
322322
},
323-
&quot;testFilePath&quot;: &quot;D:\\Github_profile\\SmartEduHub-Repo\\NotifyLog\\src\\notification\\presentation\\controllers\\notification.controller.spec.ts&quot;,
323+
&quot;testFilePath&quot;: &quot;D:\\Github_profile\\SmartEduHub-Repo\\NotifyLog\\test\\notification\\notification.controller.spec.ts&quot;,
324324
&quot;testResults&quot;: [
325325
{
326326
&quot;ancestorTitles&quot;: [
327327
&quot;NotificationController&quot;,
328328
&quot;send&quot;
329329
],
330-
&quot;duration&quot;: 30,
330+
&quot;duration&quot;: 26,
331331
&quot;failureDetails&quot;: [],
332332
&quot;failureMessages&quot;: [],
333333
&quot;fullName&quot;: &quot;NotificationController send should send notification and log successfully&quot;,
@@ -343,7 +343,7 @@ <h2>Snapshots</h2>
343343
&quot;NotificationController&quot;,
344344
&quot;send&quot;
345345
],
346-
&quot;duration&quot;: 8,
346+
&quot;duration&quot;: 9,
347347
&quot;failureDetails&quot;: [],
348348
&quot;failureMessages&quot;: [],
349349
&quot;fullName&quot;: &quot;NotificationController send should throw error if strategy send fails&quot;,
@@ -359,7 +359,7 @@ <h2>Snapshots</h2>
359359
&quot;NotificationController&quot;,
360360
&quot;getNotificationHistory&quot;
361361
],
362-
&quot;duration&quot;: 2,
362+
&quot;duration&quot;: 3,
363363
&quot;failureDetails&quot;: [],
364364
&quot;failureMessages&quot;: [],
365365
&quot;fullName&quot;: &quot;NotificationController getNotificationHistory should return notification history with default pagination&quot;,
@@ -375,7 +375,7 @@ <h2>Snapshots</h2>
375375
&quot;NotificationController&quot;,
376376
&quot;getNotificationHistory&quot;
377377
],
378-
&quot;duration&quot;: 2,
378+
&quot;duration&quot;: 1,
379379
&quot;failureDetails&quot;: [],
380380
&quot;failureMessages&quot;: [],
381381
&quot;fullName&quot;: &quot;NotificationController getNotificationHistory should handle custom pagination&quot;,
@@ -450,7 +450,7 @@ <h2>Snapshots</h2>
450450
],
451451
&quot;rootDir&quot;: &quot;D:\\Github_profile\\SmartEduHub-Repo\\NotifyLog&quot;,
452452
&quot;runTestsByPath&quot;: false,
453-
&quot;seed&quot;: 1078277408,
453+
&quot;seed&quot;: 283750242,
454454
&quot;skipFilter&quot;: false,
455455
&quot;snapshotFormat&quot;: {
456456
&quot;escapeString&quot;: false,

jest-stare/jest-results.json

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"unmatched": 0,
2727
"updated": 0
2828
},
29-
"startTime": 1747846429942,
29+
"startTime": 1748358209653,
3030
"success": false,
3131
"testResults": [
3232
{
@@ -37,10 +37,10 @@
3737
"numTodoTests": 0,
3838
"openHandles": [],
3939
"perfStats": {
40-
"end": 1747846435233,
41-
"runtime": 4662,
42-
"slow": false,
43-
"start": 1747846430571
40+
"end": 1748358215417,
41+
"runtime": 5113,
42+
"slow": true,
43+
"start": 1748358210304
4444
},
4545
"skipped": false,
4646
"snapshot": {
@@ -52,14 +52,14 @@
5252
"unmatched": 0,
5353
"updated": 0
5454
},
55-
"testFilePath": "D:\\Github_profile\\SmartEduHub-Repo\\NotifyLog\\src\\notification\\presentation\\controllers\\log.controller.spec.ts",
55+
"testFilePath": "D:\\Github_profile\\SmartEduHub-Repo\\NotifyLog\\test\\logger\\log.controller.spec.ts",
5656
"testResults": [
5757
{
5858
"ancestorTitles": [
5959
"LogController",
6060
"getLogs"
6161
],
62-
"duration": 35,
62+
"duration": 19,
6363
"failureDetails": [],
6464
"failureMessages": [],
6565
"fullName": "LogController getLogs should return logs with default pagination",
@@ -75,7 +75,7 @@
7575
"LogController",
7676
"getLogById"
7777
],
78-
"duration": 3,
78+
"duration": 2,
7979
"failureDetails": [],
8080
"failureMessages": [],
8181
"fullName": "LogController getLogById should return a log by ID",
@@ -91,7 +91,7 @@
9191
"LogController",
9292
"getLogById"
9393
],
94-
"duration": 12,
94+
"duration": 13,
9595
"failureDetails": [],
9696
"failureMessages": [],
9797
"fullName": "LogController getLogById should throw NotFoundException if log not found",
@@ -107,7 +107,7 @@
107107
"LogController",
108108
"deleteLogById"
109109
],
110-
"duration": 1,
110+
"duration": 2,
111111
"failureDetails": [],
112112
"failureMessages": [],
113113
"fullName": "LogController deleteLogById should delete a log by ID",
@@ -139,7 +139,7 @@
139139
"LogController",
140140
"getLogStats"
141141
],
142-
"duration": 2,
142+
"duration": 4,
143143
"failureDetails": [],
144144
"failureMessages": [],
145145
"fullName": "LogController getLogStats should return log statistics",
@@ -177,10 +177,10 @@
177177
"numTodoTests": 0,
178178
"openHandles": [],
179179
"perfStats": {
180-
"end": 1747846435444,
181-
"runtime": 4875,
182-
"slow": false,
183-
"start": 1747846430569
180+
"end": 1748358215656,
181+
"runtime": 5359,
182+
"slow": true,
183+
"start": 1748358210297
184184
},
185185
"skipped": false,
186186
"snapshot": {
@@ -192,14 +192,14 @@
192192
"unmatched": 0,
193193
"updated": 0
194194
},
195-
"testFilePath": "D:\\Github_profile\\SmartEduHub-Repo\\NotifyLog\\src\\notification\\presentation\\controllers\\notification.controller.spec.ts",
195+
"testFilePath": "D:\\Github_profile\\SmartEduHub-Repo\\NotifyLog\\test\\notification\\notification.controller.spec.ts",
196196
"testResults": [
197197
{
198198
"ancestorTitles": [
199199
"NotificationController",
200200
"send"
201201
],
202-
"duration": 30,
202+
"duration": 26,
203203
"failureDetails": [],
204204
"failureMessages": [],
205205
"fullName": "NotificationController send should send notification and log successfully",
@@ -215,7 +215,7 @@
215215
"NotificationController",
216216
"send"
217217
],
218-
"duration": 8,
218+
"duration": 9,
219219
"failureDetails": [],
220220
"failureMessages": [],
221221
"fullName": "NotificationController send should throw error if strategy send fails",
@@ -231,7 +231,7 @@
231231
"NotificationController",
232232
"getNotificationHistory"
233233
],
234-
"duration": 2,
234+
"duration": 3,
235235
"failureDetails": [],
236236
"failureMessages": [],
237237
"fullName": "NotificationController getNotificationHistory should return notification history with default pagination",
@@ -247,7 +247,7 @@
247247
"NotificationController",
248248
"getNotificationHistory"
249249
],
250-
"duration": 2,
250+
"duration": 1,
251251
"failureDetails": [],
252252
"failureMessages": [],
253253
"fullName": "NotificationController getNotificationHistory should handle custom pagination",

test/notification/notification.controller.spec.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ import {
1111
NotificationType,
1212
} from '../../src/config/notification.config';
1313

14+
// eslint-disable-next-line @typescript-eslint/triple-slash-reference
15+
/// <reference types="jest" />
16+
1417
describe('NotificationController', () => {
1518
let controller: NotificationController;
1619
let factory: NotificationFactory;

0 commit comments

Comments
 (0)