-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-output.txt
More file actions
1441 lines (1361 loc) · 161 KB
/
Copy pathtest-output.txt
File metadata and controls
1441 lines (1361 loc) · 161 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
bun test v1.3.14 (0d9b296a)
bun :
At line:1 char:36
+ cd "D:\web project\Interview-lab"; bun test 2>&1 | Out-File -FilePath ...
+ ~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
__tests__\api\assessments.test.ts:
(pass) GET /api/assessments (list) > returns all assessments when no filters [0.71ms]
(pass) GET /api/assessments (list) > returns empty array when no assessments [0.14ms]
(pass) GET /api/assessments (list) > filters by role [0.42ms]
(pass) GET /api/assessments (list) > filters by difficulty [0.18ms]
(pass) GET /api/assessments (list) > filters by both role and difficulty [0.17ms]
(pass) GET /api/assessments (list) > treats "all" as no filter [0.11ms]
(pass) GET /api/assessments (list) > returns empty when filter matches nothing [0.12ms]
(pass) GET /api/assessments (list) > includes answerKey in list (no stripping) [0.12ms]
(pass) GET /api/assessments (list) > returns 500 on URL error [0.20ms]
(pass) GET /api/assessments/[id] > returns assessment by id [0.26ms]
(pass) GET /api/assessments/[id] > returns 404 for non-existent id [0.10ms]
(pass) GET /api/assessments/[id] > strips answerKey and rubric [0.12ms]
(pass) GET /api/assessments/[id] > includes description and datasetInfo [0.10ms]
(pass) GET /api/assessments/[id] > returns datasetInfo as empty object when not set [0.09ms]
(pass) POST /api/assessments/[id] (submit) > returns 401 when not authenticated [0.29ms]
(pass) POST /api/assessments/[id] (submit) > returns 404 for non-existent assessment [0.10ms]
(pass) POST /api/assessments/[id] (submit) > returns 200 and logs agent run on success [0.21ms]
(pass) POST /api/assessments/[id] (submit) > stores assessmentId and answers in agent run [0.18ms]
(pass) POST /api/assessments/[id] (submit) > allows multiple submissions [0.17ms]
(pass) POST /api/assessments/[id] (submit) > returns 500 on json parse error [0.18ms]
__tests__\api\auth-login.test.ts:
(pass) POST /api/auth/login > returns 400 when email is missing [0.39ms]
(pass) POST /api/auth/login > returns 400 when password is missing [0.06ms]
(pass) POST /api/auth/login > returns 400 when both fields are missing [0.06ms]
(pass) POST /api/auth/login > returns 400 when body is empty [0.09ms]
(pass) POST /api/auth/login > returns 401 for non-existent email [0.07ms]
(pass) POST /api/auth/login > returns 401 for wrong password [0.09ms]
(pass) POST /api/auth/login > returns 401 for user without passwordHash [0.07ms]
(pass) POST /api/auth/login > returns 200 with user data on valid login [0.12ms]
(pass) POST /api/auth/login > creates a session with correct payload [0.10ms]
(pass) POST /api/auth/login > sanitizes email: trims whitespace and lowercases [0.08ms]
(pass) POST /api/auth/login > truncates email to 255 chars [0.08ms]
(pass) POST /api/auth/login > returns 429 when rate limit exceeded [0.16ms]
(pass) POST /api/auth/login > increments rate limit counter on each attempt [0.33ms]
(pass) POST /api/auth/login > uses x-real-ip when x-forwarded-for is absent [0.10ms]
(pass) POST /api/auth/login > falls back to "unknown" when no IP headers [0.13ms]
(pass) POST /api/auth/login > handles multiple x-forwarded-for IPs (uses first) [0.18ms]
(pass) POST /api/auth/login > handles error thrown during request.json() [0.17ms]
(pass) POST /api/auth/login > returns profile data when user has a profile [0.15ms]
(pass) POST /api/auth/login > returns null profile when user has no profile [0.16ms]
(pass) POST /api/auth/login > does not leak passwordHash in response [0.13ms]
(pass) POST /api/auth/login > rate limit is per-IP not global [0.12ms]
(pass) POST /api/auth/login > handles email with leading/trailing spaces [0.11ms]
(pass) POST /api/auth/logout > returns 200 with success true [0.15ms]
(pass) POST /api/auth/logout > clears the session [0.08ms]
(pass) POST /api/auth/logout > is idempotent (safe to call twice) [0.09ms]
(pass) POST /api/auth/logout > works even when no session exists [0.07ms]
__tests__\api\auth-register.test.ts:
(pass) POST /api/auth/register ΓÇö bot protection > returns fake 201 for honeypot field [0.21ms]
(pass) POST /api/auth/register ΓÇö bot protection > returns fake 201 for fast submission (< 2s) [0.04ms]
(pass) POST /api/auth/register ΓÇö bot protection > registers normally when formStart is old enough [0.21ms]
(pass) POST /api/auth/register ΓÇö required fields > rejects missing email with 400 [0.05ms]
(pass) POST /api/auth/register ΓÇö required fields > rejects missing password with 400 [0.03ms]
(pass) POST /api/auth/register ΓÇö required fields > rejects both missing with 400 [0.03ms]
(pass) POST /api/auth/register ΓÇö required fields > rejects null email with 400 [0.03ms]
(pass) POST /api/auth/register ΓÇö required fields > rejects undefined password with 400 [0.03ms]
(pass) POST /api/auth/register ΓÇö email validation > rejects email without @ [0.05ms]
(pass) POST /api/auth/register ΓÇö email validation > rejects email without domain [0.04ms]
(pass) POST /api/auth/register ΓÇö email validation > rejects email without local part [0.04ms]
(pass) POST /api/auth/register ΓÇö email validation > rejects email with spaces [0.04ms]
(pass) POST /api/auth/register ΓÇö email validation > accepts valid email [0.04ms]
(pass) POST /api/auth/register ΓÇö email validation > trims whitespace from email [0.04ms]
(pass) POST /api/auth/register ΓÇö email validation > truncates email at 255 chars [0.05ms]
(pass) POST /api/auth/register ΓÇö password validation > rejects 7-character password [0.04ms]
(pass) POST /api/auth/register ΓÇö password validation > accepts 8-character password [0.03ms]
(pass) POST /api/auth/register ΓÇö password validation > accepts long password (100+ chars) [0.03ms]
(pass) POST /api/auth/register ΓÇö password validation > accepts password with spaces [0.03ms]
(pass) POST /api/auth/register ΓÇö password validation > accepts Unicode password [0.03ms]
(pass) POST /api/auth/register ΓÇö duplicate email > rejects duplicate email with 409 [0.06ms]
(pass) POST /api/auth/register ΓÇö duplicate email > rejects duplicate regardless of case [0.03ms]
(pass) POST /api/auth/register ΓÇö duplicate email > allows same email after different registration
(pass) POST /api/auth/register ΓÇö name sanitization > uses email prefix when name is missing [0.04ms]
(pass) POST /api/auth/register ΓÇö name sanitization > strips HTML tags from name [0.06ms]
(pass) POST /api/auth/register ΓÇö name sanitization > removes special chars from name [0.04ms]
(pass) POST /api/auth/register ΓÇö name sanitization > trims whitespace from name [0.04ms]
(pass) POST /api/auth/register ΓÇö name sanitization > truncates name at 100 chars [0.03ms]
(pass) POST /api/auth/register ΓÇö name sanitization > handles empty string name [0.03ms]
(pass) POST /api/auth/register ΓÇö user cap > returns 503 when user cap reached [0.08ms]
(pass) POST /api/auth/register ΓÇö user cap > allows registration when cap not reached [0.61ms]
(pass) POST /api/auth/register ΓÇö successful registration > returns 201 with user data on success [0.13ms]
(pass) POST /api/auth/register ΓÇö successful registration > does not return passwordHash [0.04ms]
(pass) POST /api/auth/register ΓÇö successful registration > sets default subscriptionTier to free [0.04ms]
__tests__\api\auth-verify-email.test.ts:
(pass) GET /api/auth/verify-email > redirects with missing-token when no token is provided [2.32ms]
(pass) GET /api/auth/verify-email > redirects with invalid when the token cannot be validated [0.26ms]
[EMAIL VERIFICATION] Verified email for user u1 (demo@interviewlab.com)
(pass) GET /api/auth/verify-email > marks the user as verified and redirects with success for a valid token [0.31ms]
Email verification error: 56 | expect(res.headers.get('location')).toContain('/?verified=success');
57 | });
58 |
59 | it('redirects with error when the database update fails', async () => {
60 | validateVerificationToken.mockResolvedValue('demo@interviewlab.com');
61 | userUpdate.mockRejectedValue(new Error('db down'));
^
error: db down
at <anonymous> (D:\web project\Interview-lab\__tests__\api\auth-verify-email.test.ts:61:38)
(pass) GET /api/auth/verify-email > redirects with error when the database update fails [0.69ms]
__tests__\api\auth.test.ts:
16 | 'Content-Type': 'application/json',
17 | ...headers,
18 | },
19 | };
20 | if (body) opts.body = JSON.stringify(body);
21 | const res = await fetch(`${BASE_URL}${path}`, opts);
^
error: Unable to connect. Is the computer able to access the url?
path: "http://localhost:3000/api/auth/register",
errno: 0,
code: "ConnectionRefused"
at async api (D:\web project\Interview-lab\__tests__\api\auth.test.ts:21:23)
at async <anonymous> (D:\web project\Interview-lab\__tests__\api\auth.test.ts:30:38)
(fail) Auth API > POST /api/auth/register > should register a new user with valid data [7.13ms]
16 | 'Content-Type': 'application/json',
17 | ...headers,
18 | },
19 | };
20 | if (body) opts.body = JSON.stringify(body);
21 | const res = await fetch(`${BASE_URL}${path}`, opts);
^
error: Unable to connect. Is the computer able to access the url?
path: "http://localhost:3000/api/auth/register",
errno: 0,
code: "ConnectionRefused"
at async api (D:\web project\Interview-lab\__tests__\api\auth.test.ts:21:23)
at async <anonymous> (D:\web project\Interview-lab\__tests__\api\auth.test.ts:44:38)
(fail) Auth API > POST /api/auth/register > should reject duplicate email registration [0.81ms]
16 | 'Content-Type': 'application/json',
17 | ...headers,
18 | },
19 | };
20 | if (body) opts.body = JSON.stringify(body);
21 | const res = await fetch(`${BASE_URL}${path}`, opts);
^
error: Unable to connect. Is the computer able to access the url?
path: "http://localhost:3000/api/auth/register",
errno: 0,
code: "ConnectionRefused"
at async api (D:\web project\Interview-lab\__tests__\api\auth.test.ts:21:23)
at async <anonymous> (D:\web project\Interview-lab\__tests__\api\auth.test.ts:54:38)
(fail) Auth API > POST /api/auth/register > should reject missing email [0.59ms]
16 | 'Content-Type': 'application/json',
17 | ...headers,
18 | },
19 | };
20 | if (body) opts.body = JSON.stringify(body);
21 | const res = await fetch(`${BASE_URL}${path}`, opts);
^
error: Unable to connect. Is the computer able to access the url?
path: "http://localhost:3000/api/auth/register",
errno: 0,
code: "ConnectionRefused"
at async api (D:\web project\Interview-lab\__tests__\api\auth.test.ts:21:23)
at async <anonymous> (D:\web project\Interview-lab\__tests__\api\auth.test.ts:62:38)
(fail) Auth API > POST /api/auth/register > should reject missing password [0.52ms]
16 | 'Content-Type': 'application/json',
17 | ...headers,
18 | },
19 | };
20 | if (body) opts.body = JSON.stringify(body);
21 | const res = await fetch(`${BASE_URL}${path}`, opts);
^
error: Unable to connect. Is the computer able to access the url?
path: "http://localhost:3000/api/auth/login",
errno: 0,
code: "ConnectionRefused"
at async api (D:\web project\Interview-lab\__tests__\api\auth.test.ts:21:23)
at async <anonymous> (D:\web project\Interview-lab\__tests__\api\auth.test.ts:72:38)
(fail) Auth API > POST /api/auth/login > should login with valid credentials [0.49ms]
16 | 'Content-Type': 'application/json',
17 | ...headers,
18 | },
19 | };
20 | if (body) opts.body = JSON.stringify(body);
21 | const res = await fetch(`${BASE_URL}${path}`, opts);
^
error: Unable to connect. Is the computer able to access the url?
path: "http://localhost:3000/api/auth/login",
errno: 0,
code: "ConnectionRefused"
at async api (D:\web project\Interview-lab\__tests__\api\auth.test.ts:21:23)
at async <anonymous> (D:\web project\Interview-lab\__tests__\api\auth.test.ts:83:38)
(fail) Auth API > POST /api/auth/login > should reject wrong password [0.51ms]
16 | 'Content-Type': 'application/json',
17 | ...headers,
18 | },
19 | };
20 | if (body) opts.body = JSON.stringify(body);
21 | const res = await fetch(`${BASE_URL}${path}`, opts);
^
error: Unable to connect. Is the computer able to access the url?
path: "http://localhost:3000/api/auth/login",
errno: 0,
code: "ConnectionRefused"
at async api (D:\web project\Interview-lab\__tests__\api\auth.test.ts:21:23)
at async <anonymous> (D:\web project\Interview-lab\__tests__\api\auth.test.ts:92:38)
(fail) Auth API > POST /api/auth/login > should reject nonexistent user [0.49ms]
16 | 'Content-Type': 'application/json',
17 | ...headers,
18 | },
19 | };
20 | if (body) opts.body = JSON.stringify(body);
21 | const res = await fetch(`${BASE_URL}${path}`, opts);
^
error: Unable to connect. Is the computer able to access the url?
path: "http://localhost:3000/api/auth/login",
errno: 0,
code: "ConnectionRefused"
at async api (D:\web project\Interview-lab\__tests__\api\auth.test.ts:21:23)
at async <anonymous> (D:\web project\Interview-lab\__tests__\api\auth.test.ts:101:32)
(fail) Auth API > POST /api/auth/login > should reject missing fields [0.51ms]
__tests__\api\interview-session.test.ts:
(pass) Interview session creation > creates session with valid mode and targetRole [0.16ms]
(pass) Interview session creation > rejects invalid mode with 400 [0.15ms]
(pass) Interview session creation > rejects empty mode with 400 [0.03ms]
(pass) Interview session creation > rejects unauthenticated request with 401 [0.02ms]
(pass) Interview session creation > picks 5 questions for quick_drill [0.03ms]
(pass) Interview session creation > picks 10 questions for role_interview [0.02ms]
(pass) Interview session creation > picks 8 questions for technical_screen [0.02ms]
(pass) Interview session creation > picks 8 questions for client_communication [0.02ms]
(pass) Interview session creation > picks 10 questions for final_interview [0.02ms]
(pass) Interview session creation > picks 5 questions for practical_debrief [0.02ms]
(pass) Interview session creation > sanitizes HTML from mode string [0.04ms]
(pass) Answer submission > rejects unauthenticated with 401 [0.10ms]
(pass) Answer submission > returns 404 for nonexistent session [0.03ms]
(pass) Answer submission > returns 403 for non-owner [0.07ms]
(pass) Answer submission > submits answer with 201 [0.06ms]
(pass) Answer submission > stores AI score and feedback [0.06ms]
(pass) Answer submission > stores null score when not provided [0.07ms]
(pass) Session retrieval > returns session for owner [0.12ms]
(pass) Session retrieval > rejects unauthenticated GET with 401 [0.04ms]
(pass) Session retrieval > returns 403 for non-owner [0.04ms]
(pass) Session retrieval > returns 404 for nonexistent session [0.02ms]
__tests__\api\profile-dashboard.test.ts:
(pass) GET /api/profile > returns 401 when not authenticated [0.17ms]
(pass) GET /api/profile > returns onboardingDone:false when no profile exists [0.07ms]
(pass) GET /api/profile > returns profile data when it exists [0.12ms]
(pass) GET /api/profile > parses toolsKnown and weakAreas from JSON strings [0.09ms]
(pass) GET /api/profile > returns null for toolsKnown/weakAreas when they are null [0.06ms]
(pass) PUT /api/profile > returns 401 when not authenticated [0.28ms]
(pass) PUT /api/profile > updates targetRole [0.10ms]
(pass) PUT /api/profile > sanitizes text fields (strips HTML) [0.08ms]
(pass) PUT /api/profile > handles toolsKnown as array [0.08ms]
(pass) PUT /api/profile > handles weakAreas as array [0.08ms]
(pass) PUT /api/profile > handles toolsKnown as single string [0.09ms]
(pass) PUT /api/profile > handles onboardingDone boolean [0.06ms]
(pass) PUT /api/profile > defaults onboardingDone to true when non-boolean [0.06ms]
(pass) PUT /api/profile > ignores non-allowed fields [0.07ms]
(pass) PUT /api/profile > filters empty strings from toolsKnown array [0.12ms]
(pass) PUT /api/profile > handles country field [0.06ms]
(pass) PUT /api/profile > returns 500 on json error [0.16ms]
(pass) GET /api/dashboard > returns 401 when not authenticated [0.19ms]
(pass) GET /api/dashboard > returns user and profile data [0.14ms]
(pass) GET /api/dashboard > returns null user and profile when none exist [0.09ms]
(pass) GET /api/dashboard > calculates stats correctly [0.21ms]
(pass) GET /api/dashboard > returns recent items limited to 5 sessions/resumes/coverLetters [0.17ms]
(pass) GET /api/dashboard > filters empty coverLetters [0.10ms]
__tests__\api\questions-count.test.ts:
(pass) GET /api/questions/count > returns the total number of published questions [0.48ms]
Question count error: 28 | expect(body).toEqual({ total: 264 });
29 | expect(count).toHaveBeenCalledWith({ where: { status: 'published' } });
30 | });
31 |
32 | it('returns total 0 when the database throws', async () => {
33 | count.mockRejectedValue(new Error('db down'));
^
error: db down
at <anonymous> (D:\web project\Interview-lab\__tests__\api\questions-count.test.ts:33:33)
(pass) GET /api/questions/count > returns total 0 when the database throws [0.39ms]
__tests__\api\questions-interview-ai.test.ts:
20 | const opts: RequestInit = {
21 | method,
22 | headers: { 'Content-Type': 'application/json', ...headers },
23 | };
24 | if (body) opts.body = JSON.stringify(body);
25 | const res = await fetch(`${BASE_URL}${path}`, opts);
^
error: Unable to connect. Is the computer able to access the url?
path: "http://localhost:3000/api/questions",
errno: 0,
code: "ConnectionRefused"
at async api (D:\web project\Interview-lab\__tests__\api\questions-interview-ai.test.ts:25:21)
at async <anonymous> (D:\web project\Interview-lab\__tests__\api\questions-interview-ai.test.ts:44:36)
(fail) Questions API > should return questions with pagination [1.05ms]
20 | const opts: RequestInit = {
21 | method,
22 | headers: { 'Content-Type': 'application/json', ...headers },
23 | };
24 | if (body) opts.body = JSON.stringify(body);
25 | const res = await fetch(`${BASE_URL}${path}`, opts);
^
error: Unable to connect. Is the computer able to access the url?
path: "http://localhost:3000/api/questions?role=PPC%20VA",
errno: 0,
code: "ConnectionRefused"
at async api (D:\web project\Interview-lab\__tests__\api\questions-interview-ai.test.ts:25:21)
at async <anonymous> (D:\web project\Interview-lab\__tests__\api\questions-interview-ai.test.ts:53:36)
(fail) Questions API > should filter questions by role [0.57ms]
20 | const opts: RequestInit = {
21 | method,
22 | headers: { 'Content-Type': 'application/json', ...headers },
23 | };
24 | if (body) opts.body = JSON.stringify(body);
25 | const res = await fetch(`${BASE_URL}${path}`, opts);
^
error: Unable to connect. Is the computer able to access the url?
path: "http://localhost:3000/api/questions?difficulty=beginner",
errno: 0,
code: "ConnectionRefused"
at async api (D:\web project\Interview-lab\__tests__\api\questions-interview-ai.test.ts:25:21)
at async <anonymous> (D:\web project\Interview-lab\__tests__\api\questions-interview-ai.test.ts:62:36)
(fail) Questions API > should filter questions by difficulty [0.57ms]
20 | const opts: RequestInit = {
21 | method,
22 | headers: { 'Content-Type': 'application/json', ...headers },
23 | };
24 | if (body) opts.body = JSON.stringify(body);
25 | const res = await fetch(`${BASE_URL}${path}`, opts);
^
error: Unable to connect. Is the computer able to access the url?
path: "http://localhost:3000/api/questions?search=ACoS",
errno: 0,
code: "ConnectionRefused"
at async api (D:\web project\Interview-lab\__tests__\api\questions-interview-ai.test.ts:25:21)
at async <anonymous> (D:\web project\Interview-lab\__tests__\api\questions-interview-ai.test.ts:68:36)
(fail) Questions API > should search questions [0.59ms]
20 | const opts: RequestInit = {
21 | method,
22 | headers: { 'Content-Type': 'application/json', ...headers },
23 | };
24 | if (body) opts.body = JSON.stringify(body);
25 | const res = await fetch(`${BASE_URL}${path}`, opts);
^
error: Unable to connect. Is the computer able to access the url?
path: "http://localhost:3000/api/questions?limit=1",
errno: 0,
code: "ConnectionRefused"
at async api (D:\web project\Interview-lab\__tests__\api\questions-interview-ai.test.ts:25:21)
at async <anonymous> (D:\web project\Interview-lab\__tests__\api\questions-interview-ai.test.ts:74:28)
(fail) Questions API > should return questions with required fields [0.56ms]
20 | const opts: RequestInit = {
21 | method,
22 | headers: { 'Content-Type': 'application/json', ...headers },
23 | };
24 | if (body) opts.body = JSON.stringify(body);
25 | const res = await fetch(`${BASE_URL}${path}`, opts);
^
error: Unable to connect. Is the computer able to access the url?
path: "http://localhost:3000/api/auth/login",
errno: 0,
code: "ConnectionRefused"
at async api (D:\web project\Interview-lab\__tests__\api\questions-interview-ai.test.ts:25:21)
at async getDemoUser (D:\web project\Interview-lab\__tests__\api\questions-interview-ai.test.ts:35:34)
at async <anonymous> (D:\web project\Interview-lab\__tests__\api\questions-interview-ai.test.ts:90:37)
(fail) Interview API > (unnamed) [0.56ms]
20 | const opts: RequestInit = {
21 | method,
22 | headers: { 'Content-Type': 'application/json', ...headers },
23 | };
24 | if (body) opts.body = JSON.stringify(body);
25 | const res = await fetch(`${BASE_URL}${path}`, opts);
^
error: Unable to connect. Is the computer able to access the url?
path: "http://localhost:3000/api/auth/login",
errno: 0,
code: "ConnectionRefused"
at async api (D:\web project\Interview-lab\__tests__\api\questions-interview-ai.test.ts:25:21)
at async getDemoUser (D:\web project\Interview-lab\__tests__\api\questions-interview-ai.test.ts:35:34)
at async <anonymous> (D:\web project\Interview-lab\__tests__\api\questions-interview-ai.test.ts:168:37)
(fail) AI Endpoints > (unnamed) [1.40ms]
__tests__\api\questions.test.ts:
(pass) GET /api/questions ΓÇö default > returns all published questions by default [0.18ms]
(pass) GET /api/questions ΓÇö default > excludes draft questions [0.07ms]
(pass) GET /api/questions ΓÇö role filter > filters by exact role [0.09ms]
(pass) GET /api/questions ΓÇö role filter > returns empty for nonexistent role [0.09ms]
(pass) GET /api/questions ΓÇö role filter > returns all for role=all [0.05ms]
(pass) GET /api/questions ΓÇö difficulty filter > filters by beginner [0.08ms]
(pass) GET /api/questions ΓÇö difficulty filter > filters by intermediate [0.06ms]
(pass) GET /api/questions ΓÇö difficulty filter > filters by advanced [0.06ms]
(pass) GET /api/questions ΓÇö difficulty filter > returns all for difficulty=all [0.03ms]
(pass) GET /api/questions ΓÇö type filter > filters by technical [0.07ms]
(pass) GET /api/questions ΓÇö type filter > filters by behavioral [0.09ms]
(pass) GET /api/questions ΓÇö type filter > filters by scenario [0.06ms]
(pass) GET /api/questions ΓÇö type filter > filters by case_study [0.08ms]
(pass) GET /api/questions ΓÇö type filter > filters by tool_specific [0.07ms]
(pass) GET /api/questions ΓÇö type filter > filters by trick [0.09ms]
(pass) GET /api/questions ΓÇö type filter > returns all for type=all [0.03ms]
(pass) GET /api/questions ΓÇö skillArea filter > filters by PPC [0.09ms]
(pass) GET /api/questions ΓÇö skillArea filter > filters by reporting [0.07ms]
(pass) GET /api/questions ΓÇö skillArea filter > filters by keyword_research [0.09ms]
(pass) GET /api/questions ΓÇö skillArea filter > filters by client_communication [0.09ms]
(pass) GET /api/questions ΓÇö skillArea filter > returns all for skillArea=all [0.04ms]
(pass) GET /api/questions ΓÇö search > searches by keyword (case insensitive) [0.11ms]
(pass) GET /api/questions ΓÇö search > returns empty for unmatched search [0.04ms]
(pass) GET /api/questions ΓÇö search > finds campaign-related questions [0.04ms]
(pass) GET /api/questions ΓÇö search > handles empty search string [0.03ms]
(pass) GET /api/questions ΓÇö search > finds report-related questions [0.06ms]
(pass) GET /api/questions ΓÇö pagination > respects limit parameter [0.04ms]
(pass) GET /api/questions ΓÇö pagination > respects offset parameter [0.04ms]
(pass) GET /api/questions ΓÇö pagination > handles offset beyond results [0.04ms]
(pass) GET /api/questions ΓÇö pagination > defaults limit to 50 [0.03ms]
(pass) GET /api/questions ΓÇö pagination > defaults offset to 0 [0.03ms]
(pass) GET /api/questions ΓÇö combined filters > combines role and difficulty filters [0.78ms]
(pass) GET /api/questions ΓÇö combined filters > combines role and type filters [0.07ms]
(pass) GET /api/questions ΓÇö combined filters > combines all three: role, difficulty, type [0.08ms]
(pass) GET /api/questions ΓÇö combined filters > combines search with role filter [0.06ms]
(pass) GET /api/questions ΓÇö combined filters > returns empty when filters are mutually exclusive [0.03ms]
(pass) GET /api/questions ΓÇö question structure > returns questions with required fields [0.07ms]
(pass) GET /api/questions ΓÇö question structure > questions are sorted by createdAt desc [0.08ms]
__tests__\api\resources.test.ts:
20 | const opts: RequestInit = {
21 | method,
22 | headers: { 'Content-Type': 'application/json', ...headers },
23 | };
24 | if (body) opts.body = JSON.stringify(body);
25 | const res = await fetch(`${BASE_URL}${path}`, opts);
^
error: Unable to connect. Is the computer able to access the url?
path: "http://localhost:3000/api/auth/login",
errno: 0,
code: "ConnectionRefused"
at async api (D:\web project\Interview-lab\__tests__\api\resources.test.ts:25:21)
at async login (D:\web project\Interview-lab\__tests__\api\resources.test.ts:35:34)
at async <anonymous> (D:\web project\Interview-lab\__tests__\api\resources.test.ts:52:37)
(fail) Resume API > (unnamed) [3.06ms]
20 | const opts: RequestInit = {
21 | method,
22 | headers: { 'Content-Type': 'application/json', ...headers },
23 | };
24 | if (body) opts.body = JSON.stringify(body);
25 | const res = await fetch(`${BASE_URL}${path}`, opts);
^
error: Unable to connect. Is the computer able to access the url?
path: "http://localhost:3000/api/auth/login",
errno: 0,
code: "ConnectionRefused"
at async api (D:\web project\Interview-lab\__tests__\api\resources.test.ts:25:21)
at async login (D:\web project\Interview-lab\__tests__\api\resources.test.ts:35:34)
at async <anonymous> (D:\web project\Interview-lab\__tests__\api\resources.test.ts:123:37)
(fail) Cover Letter API > (unnamed) [1.05ms]
20 | const opts: RequestInit = {
21 | method,
22 | headers: { 'Content-Type': 'application/json', ...headers },
23 | };
24 | if (body) opts.body = JSON.stringify(body);
25 | const res = await fetch(`${BASE_URL}${path}`, opts);
^
error: Unable to connect. Is the computer able to access the url?
path: "http://localhost:3000/api/assessments",
errno: 0,
code: "ConnectionRefused"
at async api (D:\web project\Interview-lab\__tests__\api\resources.test.ts:25:21)
at async <anonymous> (D:\web project\Interview-lab\__tests__\api\resources.test.ts:166:36)
(fail) Assessments API > should list assessments [0.71ms]
20 | const opts: RequestInit = {
21 | method,
22 | headers: { 'Content-Type': 'application/json', ...headers },
23 | };
24 | if (body) opts.body = JSON.stringify(body);
25 | const res = await fetch(`${BASE_URL}${path}`, opts);
^
error: Unable to connect. Is the computer able to access the url?
path: "http://localhost:3000/api/assessments?role=Amazon%20PPC%20VA",
errno: 0,
code: "ConnectionRefused"
at async api (D:\web project\Interview-lab\__tests__\api\resources.test.ts:25:21)
at async <anonymous> (D:\web project\Interview-lab\__tests__\api\resources.test.ts:173:30)
(fail) Assessments API > should filter assessments by role [0.80ms]
20 | const opts: RequestInit = {
21 | method,
22 | headers: { 'Content-Type': 'application/json', ...headers },
23 | };
24 | if (body) opts.body = JSON.stringify(body);
25 | const res = await fetch(`${BASE_URL}${path}`, opts);
^
error: Unable to connect. Is the computer able to access the url?
path: "http://localhost:3000/api/downloads",
errno: 0,
code: "ConnectionRefused"
at async api (D:\web project\Interview-lab\__tests__\api\resources.test.ts:25:21)
at async <anonymous> (D:\web project\Interview-lab\__tests__\api\resources.test.ts:180:36)
(fail) Downloads API > should list downloads [0.57ms]
20 | const opts: RequestInit = {
21 | method,
22 | headers: { 'Content-Type': 'application/json', ...headers },
23 | };
24 | if (body) opts.body = JSON.stringify(body);
25 | const res = await fetch(`${BASE_URL}${path}`, opts);
^
error: Unable to connect. Is the computer able to access the url?
path: "http://localhost:3000/api/downloads",
errno: 0,
code: "ConnectionRefused"
at async api (D:\web project\Interview-lab\__tests__\api\resources.test.ts:25:21)
at async <anonymous> (D:\web project\Interview-lab\__tests__\api\resources.test.ts:188:28)
(fail) Downloads API > should validate fileName for safe characters on download [0.75ms]
20 | const opts: RequestInit = {
21 | method,
22 | headers: { 'Content-Type': 'application/json', ...headers },
23 | };
24 | if (body) opts.body = JSON.stringify(body);
25 | const res = await fetch(`${BASE_URL}${path}`, opts);
^
error: Unable to connect. Is the computer able to access the url?
path: "http://localhost:3000/api/auth/login",
errno: 0,
code: "ConnectionRefused"
at async api (D:\web project\Interview-lab\__tests__\api\resources.test.ts:25:21)
at async login (D:\web project\Interview-lab\__tests__\api\resources.test.ts:35:34)
at async <anonymous> (D:\web project\Interview-lab\__tests__\api\resources.test.ts:200:37)
(fail) Guides API > (unnamed) [0.53ms]
20 | const opts: RequestInit = {
21 | method,
22 | headers: { 'Content-Type': 'application/json', ...headers },
23 | };
24 | if (body) opts.body = JSON.stringify(body);
25 | const res = await fetch(`${BASE_URL}${path}`, opts);
^
error: Unable to connect. Is the computer able to access the url?
path: "http://localhost:3000/api/auth/login",
errno: 0,
code: "ConnectionRefused"
at async api (D:\web project\Interview-lab\__tests__\api\resources.test.ts:25:21)
at async login (D:\web project\Interview-lab\__tests__\api\resources.test.ts:35:34)
at async <anonymous> (D:\web project\Interview-lab\__tests__\api\resources.test.ts:254:38)
(fail) Admin API > (unnamed) [0.53ms]
20 | const opts: RequestInit = {
21 | method,
22 | headers: { 'Content-Type': 'application/json', ...headers },
23 | };
24 | if (body) opts.body = JSON.stringify(body);
25 | const res = await fetch(`${BASE_URL}${path}`, opts);
^
error: Unable to connect. Is the computer able to access the url?
path: "http://localhost:3000/api/auth/login",
errno: 0,
code: "ConnectionRefused"
at async api (D:\web project\Interview-lab\__tests__\api\resources.test.ts:25:21)
at async login (D:\web project\Interview-lab\__tests__\api\resources.test.ts:35:34)
at async <anonymous> (D:\web project\Interview-lab\__tests__\api\resources.test.ts:299:37)
(fail) Export API > (unnamed) [0.54ms]
__tests__\api\resume-coverletter.test.ts:
(pass) GET /api/resume > returns 401 when not authenticated [0.18ms]
(pass) GET /api/resume > returns resumes for authenticated user [0.12ms]
(pass) GET /api/resume > does not return other users resumes [0.07ms]
(pass) GET /api/resume > returns empty array when no resumes [0.05ms]
(pass) POST /api/resume > returns 401 when not authenticated [0.18ms]
(pass) POST /api/resume > returns 400 when originalText is empty [0.11ms]
(pass) POST /api/resume > returns 400 when originalText is not provided [0.07ms]
(pass) POST /api/resume > creates resume with sanitized text [0.08ms]
(pass) POST /api/resume > strips HTML from text fields [0.08ms]
(pass) POST /api/resume > returns 500 on json error [0.13ms]
(pass) GET /api/cover-letter > returns 401 when not authenticated [0.10ms]
(pass) GET /api/cover-letter > returns cover letters for user [0.08ms]
(pass) GET /api/cover-letter > does not return other users cover letters [0.07ms]
(pass) POST /api/cover-letter > returns 401 when not authenticated [0.21ms]
(pass) POST /api/cover-letter > returns 400 when jobDescription is empty [0.08ms]
(pass) POST /api/cover-letter > creates cover letter with default tone [0.08ms]
(pass) POST /api/cover-letter > accepts valid tone [0.07ms]
(pass) POST /api/cover-letter > accepts all allowed tones [0.14ms]
(pass) POST /api/cover-letter > stores truth flags as JSON string [0.16ms]
(pass) POST /api/cover-letter > filters non-string truth flags [0.08ms]
(pass) POST /api/cover-letter > returns null truthFlags when array is empty [0.06ms]
(pass) POST /api/cover-letter > returns null truthFlags when not provided [0.06ms]
(pass) POST /api/cover-letter > sanitizes generatedLetter [0.05ms]
(pass) POST /api/cover-letter > sanitizes jobDescription (strips HTML) [0.07ms]
(pass) POST /api/cover-letter > returns 500 on json error [0.19ms]
__tests__\api\user-paths.test.ts:
21 | const opts: RequestInit = {
22 | method,
23 | headers: { 'Content-Type': 'application/json', ...headers },
24 | };
25 | if (body) opts.body = JSON.stringify(body);
26 | const res = await fetch(`${BASE_URL}${path}`, opts);
^
error: Unable to connect. Is the computer able to access the url?
path: "http://localhost:3000/api/auth/register",
errno: 0,
code: "ConnectionRefused"
at async api (D:\web project\Interview-lab\__tests__\api\user-paths.test.ts:26:21)
at async <anonymous> (D:\web project\Interview-lab\__tests__\api\user-paths.test.ts:45:36)
(fail) User Path: New User Registration to First Interview > Step 1: Register a new account [2.13ms]
21 | const opts: RequestInit = {
22 | method,
23 | headers: { 'Content-Type': 'application/json', ...headers },
24 | };
25 | if (body) opts.body = JSON.stringify(body);
26 | const res = await fetch(`${BASE_URL}${path}`, opts);
^
error: Unable to connect. Is the computer able to access the url?
path: "http://localhost:3000/api/auth/login",
errno: 0,
code: "ConnectionRefused"
at async api (D:\web project\Interview-lab\__tests__\api\user-paths.test.ts:26:21)
at async <anonymous> (D:\web project\Interview-lab\__tests__\api\user-paths.test.ts:55:44)
(fail) User Path: New User Registration to First Interview > Step 2: Login with new credentials [0.67ms]
21 | const opts: RequestInit = {
22 | method,
23 | headers: { 'Content-Type': 'application/json', ...headers },
24 | };
25 | if (body) opts.body = JSON.stringify(body);
26 | const res = await fetch(`${BASE_URL}${path}`, opts);
^
error: Unable to connect. Is the computer able to access the url?
path: "http://localhost:3000/api/profile",
errno: 0,
code: "ConnectionRefused"
at async api (D:\web project\Interview-lab\__tests__\api\user-paths.test.ts:26:21)
at async <anonymous> (D:\web project\Interview-lab\__tests__\api\user-paths.test.ts:65:30)
(fail) User Path: New User Registration to First Interview > Step 3: Get profile (should have onboardingDone: false)
[0.51ms]
21 | const opts: RequestInit = {
22 | method,
23 | headers: { 'Content-Type': 'application/json', ...headers },
24 | };
25 | if (body) opts.body = JSON.stringify(body);
26 | const res = await fetch(`${BASE_URL}${path}`, opts);
^
error: Unable to connect. Is the computer able to access the url?
path: "http://localhost:3000/api/profile",
errno: 0,
code: "ConnectionRefused"
at async api (D:\web project\Interview-lab\__tests__\api\user-paths.test.ts:26:21)
at async <anonymous> (D:\web project\Interview-lab\__tests__\api\user-paths.test.ts:73:30)
(fail) User Path: New User Registration to First Interview > Step 4: Complete onboarding (update profile) [0.49ms]
21 | const opts: RequestInit = {
22 | method,
23 | headers: { 'Content-Type': 'application/json', ...headers },
24 | };
25 | if (body) opts.body = JSON.stringify(body);
26 | const res = await fetch(`${BASE_URL}${path}`, opts);
^
error: Unable to connect. Is the computer able to access the url?
path: "http://localhost:3000/api/dashboard",
errno: 0,
code: "ConnectionRefused"
at async api (D:\web project\Interview-lab\__tests__\api\user-paths.test.ts:26:21)
at async <anonymous> (D:\web project\Interview-lab\__tests__\api\user-paths.test.ts:88:36)
(fail) User Path: New User Registration to First Interview > Step 5: View dashboard [0.51ms]
21 | const opts: RequestInit = {
22 | method,
23 | headers: { 'Content-Type': 'application/json', ...headers },
24 | };
25 | if (body) opts.body = JSON.stringify(body);
26 | const res = await fetch(`${BASE_URL}${path}`, opts);
^
error: Unable to connect. Is the computer able to access the url?
path: "http://localhost:3000/api/questions?role=PPC+VA",
errno: 0,
code: "ConnectionRefused"
at async api (D:\web project\Interview-lab\__tests__\api\user-paths.test.ts:26:21)
at async <anonymous> (D:\web project\Interview-lab\__tests__\api\user-paths.test.ts:97:36)
(fail) User Path: New User Registration to First Interview > Step 6: Browse questions [0.54ms]
21 | const opts: RequestInit = {
22 | method,
23 | headers: { 'Content-Type': 'application/json', ...headers },
24 | };
25 | if (body) opts.body = JSON.stringify(body);
26 | const res = await fetch(`${BASE_URL}${path}`, opts);
^
error: Unable to connect. Is the computer able to access the url?
path: "http://localhost:3000/api/interview",
errno: 0,
code: "ConnectionRefused"
at async api (D:\web project\Interview-lab\__tests__\api\user-paths.test.ts:26:21)
at async <anonymous> (D:\web project\Interview-lab\__tests__\api\user-paths.test.ts:103:36)
(fail) User Path: New User Registration to First Interview > Step 7: Start a quick drill interview [0.54ms]
21 | const opts: RequestInit = {
22 | method,
23 | headers: { 'Content-Type': 'application/json', ...headers },
24 | };
25 | if (body) opts.body = JSON.stringify(body);
26 | const res = await fetch(`${BASE_URL}${path}`, opts);
^
error: Unable to connect. Is the computer able to access the url?
path: "http://localhost:3000/api/downloads",
errno: 0,
code: "ConnectionRefused"
at async api (D:\web project\Interview-lab\__tests__\api\user-paths.test.ts:26:21)
at async <anonymous> (D:\web project\Interview-lab\__tests__\api\user-paths.test.ts:114:36)
(fail) User Path: New User Registration to First Interview > Step 8: View downloads [0.54ms]
21 | const opts: RequestInit = {
22 | method,
23 | headers: { 'Content-Type': 'application/json', ...headers },
24 | };
25 | if (body) opts.body = JSON.stringify(body);
26 | const res = await fetch(`${BASE_URL}${path}`, opts);
^
error: Unable to connect. Is the computer able to access the url?
path: "http://localhost:3000/api/guides",
errno: 0,
code: "ConnectionRefused"
at async api (D:\web project\Interview-lab\__tests__\api\user-paths.test.ts:26:21)
at async <anonymous> (D:\web project\Interview-lab\__tests__\api\user-paths.test.ts:120:36)
(fail) User Path: New User Registration to First Interview > Step 9: View learning paths [0.49ms]
21 | const opts: RequestInit = {
22 | method,
23 | headers: { 'Content-Type': 'application/json', ...headers },
24 | };
25 | if (body) opts.body = JSON.stringify(body);
26 | const res = await fetch(`${BASE_URL}${path}`, opts);
^
error: Unable to connect. Is the computer able to access the url?
path: "http://localhost:3000/api/auth/login",
errno: 0,
code: "ConnectionRefused"
at async api (D:\web project\Interview-lab\__tests__\api\user-paths.test.ts:26:21)
at async login (D:\web project\Interview-lab\__tests__\api\user-paths.test.ts:36:34)
at async <anonymous> (D:\web project\Interview-lab\__tests__\api\user-paths.test.ts:131:37)
(fail) User Path: Resume Review Flow > (unnamed) [0.56ms]
21 | const opts: RequestInit = {
22 | method,
23 | headers: { 'Content-Type': 'application/json', ...headers },
24 | };
25 | if (body) opts.body = JSON.stringify(body);
26 | const res = await fetch(`${BASE_URL}${path}`, opts);
^
error: Unable to connect. Is the computer able to access the url?
path: "http://localhost:3000/api/auth/login",
errno: 0,
code: "ConnectionRefused"
at async api (D:\web project\Interview-lab\__tests__\api\user-paths.test.ts:26:21)
at async login (D:\web project\Interview-lab\__tests__\api\user-paths.test.ts:36:34)
at async <anonymous> (D:\web project\Interview-lab\__tests__\api\user-paths.test.ts:178:37)
(fail) User Path: Full Interview Session > (unnamed) [4.53ms]
21 | const opts: RequestInit = {
22 | method,
23 | headers: { 'Content-Type': 'application/json', ...headers },
24 | };
25 | if (body) opts.body = JSON.stringify(body);
26 | const res = await fetch(`${BASE_URL}${path}`, opts);
^
error: Unable to connect. Is the computer able to access the url?
path: "http://localhost:3000/api/auth/login",
errno: 0,
code: "ConnectionRefused"
at async api (D:\web project\Interview-lab\__tests__\api\user-paths.test.ts:26:21)
at async login (D:\web project\Interview-lab\__tests__\api\user-paths.test.ts:36:34)
at async <anonymous> (D:\web project\Interview-lab\__tests__\api\user-paths.test.ts:228:37)
(fail) User Path: Cover Letter Generation > (unnamed) [0.84ms]
21 | const opts: RequestInit = {
22 | method,
23 | headers: { 'Content-Type': 'application/json', ...headers },
24 | };
25 | if (body) opts.body = JSON.stringify(body);
26 | const res = await fetch(`${BASE_URL}${path}`, opts);
^
error: Unable to connect. Is the computer able to access the url?
path: "http://localhost:3000/api/auth/login",
errno: 0,
code: "ConnectionRefused"
at async api (D:\web project\Interview-lab\__tests__\api\user-paths.test.ts:26:21)
at async login (D:\web project\Interview-lab\__tests__\api\user-paths.test.ts:36:34)
at async <anonymous> (D:\web project\Interview-lab\__tests__\api\user-paths.test.ts:259:37)
(fail) User Path: Learning Path Progress > (unnamed) [0.58ms]
21 | const opts: RequestInit = {
22 | method,
23 | headers: { 'Content-Type': 'application/json', ...headers },
24 | };
25 | if (body) opts.body = JSON.stringify(body);
26 | const res = await fetch(`${BASE_URL}${path}`, opts);
^
error: Unable to connect. Is the computer able to access the url?
path: "http://localhost:3000/api/auth/login",
errno: 0,
code: "ConnectionRefused"
at async api (D:\web project\Interview-lab\__tests__\api\user-paths.test.ts:26:21)
at async login (D:\web project\Interview-lab\__tests__\api\user-paths.test.ts:36:34)
at async <anonymous> (D:\web project\Interview-lab\__tests__\api\user-paths.test.ts:310:38)
(fail) User Path: Admin Operations > (unnamed) [0.52ms]
__tests__\components\auth-context.test.ts:
24 | global.fetch = mockFetch;
25 |
26 | describe('AuthContext - Login Flow', () => {
27 | beforeEach(() => {
28 | mockFetch.mockReset();
29 | localStorage.clear();
^
ReferenceError: localStorage is not defined
at <anonymous> (D:\web project\Interview-lab\__tests__\components\auth-context.test.ts:29:5)
(fail) AuthContext - Login Flow > should store user in localStorage on successful login [0.22ms]
24 | global.fetch = mockFetch;
25 |
26 | describe('AuthContext - Login Flow', () => {
27 | beforeEach(() => {
28 | mockFetch.mockReset();
29 | localStorage.clear();
^
ReferenceError: localStorage is not defined
at <anonymous> (D:\web project\Interview-lab\__tests__\components\auth-context.test.ts:29:5)
(fail) AuthContext - Login Flow > should handle login failure [0.13ms]
(pass) AuthContext - Register Flow > should call register API with correct data [0.17ms]
(pass) AuthContext - Register Flow > should handle duplicate email registration [0.09ms]
124 | });
125 | });
126 |
127 | describe('AuthContext - Session Persistence', () => {
128 | beforeEach(() => {
129 | localStorage.clear();
^
ReferenceError: localStorage is not defined
at <anonymous> (D:\web project\Interview-lab\__tests__\components\auth-context.test.ts:129:5)
(fail) AuthContext - Session Persistence > should persist user data in localStorage [0.14ms]
124 | });
125 | });
126 |
127 | describe('AuthContext - Session Persistence', () => {
128 | beforeEach(() => {
129 | localStorage.clear();
^
ReferenceError: localStorage is not defined
at <anonymous> (D:\web project\Interview-lab\__tests__\components\auth-context.test.ts:129:5)
(fail) AuthContext - Session Persistence > should clear localStorage on logout [2.71ms]
__tests__\components\hydration-safety.test.ts:
(pass) Hydration Safety > auth-context should not use typeof window in useState initializers [0.46ms]
(pass) Hydration Safety > auth-context should initialize loading as true for SSR consistency [0.19ms]
(pass) Hydration Safety > auth-context should read localStorage only in useEffect [0.33ms]
(pass) Hydration Safety > LandingPage should not use new Date() in render [0.23ms]
(pass) Hydration Safety > no component should use typeof window checks in JSX return [3.27ms]
(pass) ROLES Consistency > all filter dropdowns should use ROLES from types.ts [0.96ms]
(pass) ROLES Consistency > OnboardingQuiz should have descriptions for all ROLES [0.43ms]
__tests__\components\mock-interview.test.tsx:
251 | throw error;
252 | }
253 | if (!baseElement) {
254 | // default to document.body instead of documentElement to avoid output of potentially-large
255 | // head elements (such as JSS style blocks) in debug output
256 | baseElement = document.body;
^
ReferenceError: document is not defined
at render (D:\web project\Interview-lab\node_modules\@testing-library\react\dist\pure.js:256:19)
at <anonymous> (D:\web project\Interview-lab\__tests__\components\mock-interview.test.tsx:39:5)
(fail) MockInterview > renders the interview setup screen with mode options [7.85ms]
251 | throw error;
252 | }
253 | if (!baseElement) {
254 | // default to document.body instead of documentElement to avoid output of potentially-large
255 | // head elements (such as JSS style blocks) in debug output
256 | baseElement = document.body;
^
ReferenceError: document is not defined
at render (D:\web project\Interview-lab\node_modules\@testing-library\react\dist\pure.js:256:19)
at <anonymous> (D:\web project\Interview-lab\__tests__\components\mock-interview.test.tsx:45:5)
(fail) MockInterview > fetches previous sessions for the logged-in user on mount [0.44ms]
251 | throw error;
252 | }
253 | if (!baseElement) {
254 | // default to document.body instead of documentElement to avoid output of potentially-large
255 | // head elements (such as JSS style blocks) in debug output
256 | baseElement = document.body;
^
ReferenceError: document is not defined
at render (D:\web project\Interview-lab\node_modules\@testing-library\react\dist\pure.js:256:19)
at <anonymous> (D:\web project\Interview-lab\__tests__\components\mock-interview.test.tsx:50:5)
(fail) MockInterview > disables Start Interview until a mode is selected [0.24ms]
251 | throw error;
252 | }
253 | if (!baseElement) {
254 | // default to document.body instead of documentElement to avoid output of potentially-large
255 | // head elements (such as JSS style blocks) in debug output
256 | baseElement = document.body;
^
ReferenceError: document is not defined
at render (D:\web project\Interview-lab\node_modules\@testing-library\react\dist\pure.js:256:19)
at <anonymous> (D:\web project\Interview-lab\__tests__\components\mock-interview.test.tsx:55:5)
(fail) MockInterview > enables Start Interview after selecting a mode [0.32ms]
251 | throw error;
252 | }
253 | if (!baseElement) {
254 | // default to document.body instead of documentElement to avoid output of potentially-large
255 | // head elements (such as JSS style blocks) in debug output
256 | baseElement = document.body;
^
ReferenceError: document is not defined
at render (D:\web project\Interview-lab\node_modules\@testing-library\react\dist\pure.js:256:19)
at <anonymous> (D:\web project\Interview-lab\__tests__\components\mock-interview.test.tsx:76:5)
(fail) MockInterview > starts an interview session and renders the first question [0.46ms]
251 | throw error;
252 | }
253 | if (!baseElement) {
254 | // default to document.body instead of documentElement to avoid output of potentially-large
255 | // head elements (such as JSS style blocks) in debug output
256 | baseElement = document.body;
^
ReferenceError: document is not defined
at render (D:\web project\Interview-lab\node_modules\@testing-library\react\dist\pure.js:256:19)
at <anonymous> (D:\web project\Interview-lab\__tests__\components\mock-interview.test.tsx:101:5)
(fail) MockInterview > disables Submit Answer until an answer is typed [0.40ms]
__tests__\components\onboarding-quiz.test.tsx:
251 | throw error;
252 | }
253 | if (!baseElement) {
254 | // default to document.body instead of documentElement to avoid output of potentially-large
255 | // head elements (such as JSS style blocks) in debug output
256 | baseElement = document.body;
^
ReferenceError: document is not defined
at render (D:\web project\Interview-lab\node_modules\@testing-library\react\dist\pure.js:256:19)
at <anonymous> (D:\web project\Interview-lab\__tests__\components\onboarding-quiz.test.tsx:25:5)
(fail) OnboardingQuiz > renders the first step with a role selection prompt [0.41ms]
251 | throw error;
252 | }
253 | if (!baseElement) {
254 | // default to document.body instead of documentElement to avoid output of potentially-large
255 | // head elements (such as JSS style blocks) in debug output
256 | baseElement = document.body;
^
ReferenceError: document is not defined
at render (D:\web project\Interview-lab\node_modules\@testing-library\react\dist\pure.js:256:19)
at <anonymous> (D:\web project\Interview-lab\__tests__\components\onboarding-quiz.test.tsx:32:5)
(fail) OnboardingQuiz > disables Next until a role is selected on step 1 [0.19ms]
251 | throw error;
252 | }
253 | if (!baseElement) {
254 | // default to document.body instead of documentElement to avoid output of potentially-large
255 | // head elements (such as JSS style blocks) in debug output
256 | baseElement = document.body;
^
ReferenceError: document is not defined
at render (D:\web project\Interview-lab\node_modules\@testing-library\react\dist\pure.js:256:19)
at <anonymous> (D:\web project\Interview-lab\__tests__\components\onboarding-quiz.test.tsx:37:5)
(fail) OnboardingQuiz > advances to step 2 after selecting a role and clicking Next [0.25ms]
251 | throw error;
252 | }
253 | if (!baseElement) {
254 | // default to document.body instead of documentElement to avoid output of potentially-large
255 | // head elements (such as JSS style blocks) in debug output
256 | baseElement = document.body;
^
ReferenceError: document is not defined
at render (D:\web project\Interview-lab\node_modules\@testing-library\react\dist\pure.js:256:19)
at <anonymous> (D:\web project\Interview-lab\__tests__\components\onboarding-quiz.test.tsx:45:5)
(fail) OnboardingQuiz > goes back to the previous step [0.22ms]
251 | throw error;
252 | }
253 | if (!baseElement) {