@@ -36,26 +36,20 @@ describe('parseHuggingFaceUrl', () => {
3636 test . for ( [
3737 '' ,
3838 '/' ,
39- '/anything' ,
40- '/tasks' ,
41- '/models' ,
42- '/spaces' ,
39+ // for the following tests, the same is true:
40+ // - with a trailing slash
41+ // - replacing /datasets with /anything, /spaces, /models or /.
42+ // Avoiding for brevity.
4343 '/datasets' ,
44- '/datasets/' ,
4544 '/datasets/namespace' ,
46- '/datasets/namespace/' ,
4745 '/datasets/namespace/repo/branch' ,
4846 '/datasets/namespace/repo/tree' ,
49- '/datasets/namespace/repo/tree/' ,
5047 '/datasets/namespace/repo/blob' ,
51- '/datasets/namespace/repo/blob/' ,
52- '/datasets/namespace/repo/blob/branch' ,
53- '/datasets/namespace/repo/blob/branch/' ,
54- '/datasets/namespace/repo/blob/branch/file/' ,
5548 '/datasets/namespace/repo/resolve' ,
56- '/datasets/namespace/repo/resolve/ ' ,
49+ '/datasets/namespace/repo/blob/branch ' ,
5750 '/datasets/namespace/repo/resolve/branch' ,
58- '/datasets/namespace/repo/resolve/branch/' ,
51+ // note the trailing slash
52+ '/datasets/namespace/repo/blob/branch/file/' ,
5953 '/datasets/namespace/repo/resolve/branch/file/' ,
6054 ] ) ( 'throws for invalid path: %s' , ( path ) => {
6155 expect ( ( ) => parseHuggingFaceUrl ( `https://huggingface.co${ path } ` ) ) . to . throw ( )
0 commit comments