11import { Credential , LeetCode , LeetCodeCN } from "leetcode-query" ;
22import { describe , expect , it } from "vitest" ;
3- import { LeetCodeCNService } from "../../src/services /leetcode-cn-service" ;
4- import { LeetCodeGlobalService } from "../../src/services /leetcode-global-service" ;
3+ import { LeetCodeCNService } from "../../src/leetcode /leetcode-cn-service.js " ;
4+ import { LeetCodeGlobalService } from "../../src/leetcode /leetcode-global-service.js " ;
55
66describe ( "LeetCode Solution Services" , ( ) => {
77 describe ( "LeetCodeGlobalService" , ( ) => {
@@ -20,7 +20,7 @@ describe("LeetCode Solution Services", () => {
2020
2121 expect ( result ) . toBeDefined ( ) ;
2222 expect ( result . totalNum ) . toBeTypeOf ( "number" ) ;
23- expect ( Array . isArray ( result . edges ) ) . toBe ( true ) ;
23+ expect ( Array . isArray ( result . articles ) ) . toBe ( true ) ;
2424 } , 30000 ) ;
2525
2626 it ( "should fetch solution articles with custom options" , async ( ) => {
@@ -35,9 +35,9 @@ describe("LeetCode Solution Services", () => {
3535
3636 expect ( result ) . toBeDefined ( ) ;
3737 expect ( result . totalNum ) . toBeTypeOf ( "number" ) ;
38- expect ( Array . isArray ( result . edges ) ) . toBe ( true ) ;
38+ expect ( Array . isArray ( result . articles ) ) . toBe ( true ) ;
3939
40- expect ( result . edges . length ) . toBeLessThanOrEqual ( 5 ) ;
40+ expect ( result . articles . length ) . toBeLessThanOrEqual ( 5 ) ;
4141 } , 30000 ) ;
4242
4343 it ( "should handle errors properly for invalid slugs" , async ( ) => {
@@ -108,7 +108,7 @@ describe("LeetCode Solution Services", () => {
108108
109109 expect ( result ) . toBeDefined ( ) ;
110110 expect ( result . totalNum ) . toBeTypeOf ( "number" ) ;
111- expect ( Array . isArray ( result . edges ) ) . toBe ( true ) ;
111+ expect ( Array . isArray ( result . articles ) ) . toBe ( true ) ;
112112
113113 console . log (
114114 `Found ${ result . totalNum } solutions for ${ questionSlug } on CN`
@@ -127,9 +127,9 @@ describe("LeetCode Solution Services", () => {
127127
128128 expect ( result ) . toBeDefined ( ) ;
129129 expect ( result . totalNum ) . toBeTypeOf ( "number" ) ;
130- expect ( Array . isArray ( result . edges ) ) . toBe ( true ) ;
130+ expect ( Array . isArray ( result . articles ) ) . toBe ( true ) ;
131131
132- expect ( result . edges . length ) . toBeLessThanOrEqual ( 5 ) ;
132+ expect ( result . articles . length ) . toBeLessThanOrEqual ( 5 ) ;
133133 } , 30000 ) ;
134134
135135 it ( "should handle errors properly for invalid slugs" , async ( ) => {
0 commit comments