@@ -10,6 +10,17 @@ describe("LeetCode Problem Services", () => {
10
10
const leetCodeApi = new LeetCode ( credential ) ;
11
11
const service = new LeetCodeGlobalService ( leetCodeApi , credential ) ;
12
12
13
+ describe ( "fetchDailyChallenge" , ( ) => {
14
+ it ( "should return daily challenge data" , async ( ) => {
15
+ const result = await service . fetchDailyChallenge ( ) ;
16
+
17
+ expect ( result ) . toBeDefined ( ) ;
18
+ expect ( result . question ) . toBeDefined ( ) ;
19
+ expect ( result . question . title ) . toBeDefined ( ) ;
20
+ expect ( result . question . questionId ) . toBeDefined ( ) ;
21
+ } , 30000 ) ;
22
+ } ) ;
23
+
13
24
describe ( "fetchProblemSimplified" , ( ) => {
14
25
it ( "should return simplified problem data" , async ( ) => {
15
26
const titleSlug = "two-sum" ;
@@ -44,6 +55,17 @@ describe("LeetCode Problem Services", () => {
44
55
const leetCodeApi = new LeetCodeCN ( credential ) ;
45
56
const service = new LeetCodeCNService ( leetCodeApi , credential ) ;
46
57
58
+ describe ( "fetchDailyChallenge" , ( ) => {
59
+ it ( "should return daily challenge data" , async ( ) => {
60
+ service . fetchDailyChallenge ( ) . then ( ( result ) => {
61
+ expect ( result ) . toBeDefined ( ) ;
62
+ expect ( result . question ) . toBeDefined ( ) ;
63
+ expect ( result . question . title ) . toBeDefined ( ) ;
64
+ expect ( result . question . questionId ) . toBeDefined ( ) ;
65
+ } ) ;
66
+ } , 30000 ) ;
67
+ } ) ;
68
+
47
69
describe ( "fetchProblemSimplified" , ( ) => {
48
70
it ( "should return simplified problem data" , async ( ) => {
49
71
const titleSlug = "two-sum" ;
0 commit comments