@@ -13,17 +13,17 @@ describe("Capture URL Builder", () => {
13
13
const url = capture . buildImageUrl ( "https://news.ycombinator.com/" ) ;
14
14
console . log ( url ) ;
15
15
expect ( url ) . toBe (
16
- "https://cdn.capture.techulus.in /test/f37d5fb3ee4540a05bf4ffeed6dffa28/image?url=https%3A%2F%2Fnews.ycombinator.com%2F" ,
16
+ "https://cdn.capture.page /test/f37d5fb3ee4540a05bf4ffeed6dffa28/image?url=https%3A%2F%2Fnews.ycombinator.com%2F" ,
17
17
) ;
18
18
} ) ;
19
19
20
20
it ( "buildImageUrl with options should return valid url" , ( ) => {
21
- const url = capture . buildImageUrl ( "https://capture.techulus.in /" , {
21
+ const url = capture . buildImageUrl ( "https://capture.page /" , {
22
22
full : true ,
23
23
delay : 3 ,
24
24
} ) ;
25
25
expect ( url ) . toBe (
26
- "https://cdn.capture.techulus.in /test/2cb8b7ed9dbdb5c0db4a5dc4523a0780 /image?full=true&delay=3&url=https%3A%2F%2Fcapture.techulus.in %2F" ,
26
+ "https://cdn.capture.page /test/0e944abb6d823d0c8618dc22e508be6d /image?full=true&delay=3&url=https%3A%2F%2Fcapture.page %2F" ,
27
27
) ;
28
28
} ) ;
29
29
} ) ;
@@ -37,17 +37,17 @@ describe("Capture URL Builder", () => {
37
37
it ( "buildPdfUrl should return valid url" , ( ) => {
38
38
const url = capture . buildPdfUrl ( "https://news.ycombinator.com/" ) ;
39
39
expect ( url ) . toBe (
40
- "https://cdn.capture.techulus.in /test/f37d5fb3ee4540a05bf4ffeed6dffa28/pdf?url=https%3A%2F%2Fnews.ycombinator.com%2F" ,
40
+ "https://cdn.capture.page /test/f37d5fb3ee4540a05bf4ffeed6dffa28/pdf?url=https%3A%2F%2Fnews.ycombinator.com%2F" ,
41
41
) ;
42
42
} ) ;
43
43
44
44
it ( "buildPdfUrl with options should return valid url" , ( ) => {
45
- const url = capture . buildPdfUrl ( "https://capture.techulus.in /" , {
45
+ const url = capture . buildPdfUrl ( "https://capture.page /" , {
46
46
full : true ,
47
47
delay : 3 ,
48
48
} ) ;
49
49
expect ( url ) . toBe (
50
- "https://cdn.capture.techulus.in /test/2cb8b7ed9dbdb5c0db4a5dc4523a0780 /pdf?full=true&delay=3&url=https%3A%2F%2Fcapture.techulus.in %2F" ,
50
+ "https://cdn.capture.page /test/0e944abb6d823d0c8618dc22e508be6d /pdf?full=true&delay=3&url=https%3A%2F%2Fcapture.page %2F" ,
51
51
) ;
52
52
} ) ;
53
53
} ) ;
@@ -61,7 +61,7 @@ describe("Capture URL Builder", () => {
61
61
it ( "buildContentUrl should return valid url" , ( ) => {
62
62
const url = capture . buildContentUrl ( "https://news.ycombinator.com/" ) ;
63
63
expect ( url ) . toBe (
64
- "https://cdn.capture.techulus.in /test/f37d5fb3ee4540a05bf4ffeed6dffa28/content?url=https%3A%2F%2Fnews.ycombinator.com%2F" ,
64
+ "https://cdn.capture.page /test/f37d5fb3ee4540a05bf4ffeed6dffa28/content?url=https%3A%2F%2Fnews.ycombinator.com%2F" ,
65
65
) ;
66
66
} ) ;
67
67
} ) ;
@@ -75,8 +75,32 @@ describe("Capture URL Builder", () => {
75
75
it ( "buildMetadataUrl should return valid url" , ( ) => {
76
76
const url = capture . buildMetadataUrl ( "https://news.ycombinator.com/" ) ;
77
77
expect ( url ) . toBe (
78
- "https://cdn.capture.techulus.in /test/f37d5fb3ee4540a05bf4ffeed6dffa28/metadata?url=https%3A%2F%2Fnews.ycombinator.com%2F" ,
78
+ "https://cdn.capture.page /test/f37d5fb3ee4540a05bf4ffeed6dffa28/metadata?url=https%3A%2F%2Fnews.ycombinator.com%2F" ,
79
79
) ;
80
80
} ) ;
81
81
} ) ;
82
82
} ) ;
83
+
84
+ describe ( "Capture URL Builder with useEdge" , ( ) => {
85
+ const edgeCapture = new Capture ( "test" , "test" , { useEdge : true } ) ;
86
+
87
+ it ( "buildImageUrl should use edge URL" , ( ) => {
88
+ const url = edgeCapture . buildImageUrl ( "https://news.ycombinator.com/" ) ;
89
+ expect ( url . startsWith ( "https://edge.capture.page/" ) ) . toBe ( true ) ;
90
+ } ) ;
91
+
92
+ it ( "buildPdfUrl should use edge URL" , ( ) => {
93
+ const url = edgeCapture . buildPdfUrl ( "https://news.ycombinator.com/" ) ;
94
+ expect ( url . startsWith ( "https://edge.capture.page/" ) ) . toBe ( true ) ;
95
+ } ) ;
96
+
97
+ it ( "buildContentUrl should use edge URL" , ( ) => {
98
+ const url = edgeCapture . buildContentUrl ( "https://news.ycombinator.com/" ) ;
99
+ expect ( url . startsWith ( "https://edge.capture.page/" ) ) . toBe ( true ) ;
100
+ } ) ;
101
+
102
+ it ( "buildMetadataUrl should use edge URL" , ( ) => {
103
+ const url = edgeCapture . buildMetadataUrl ( "https://news.ycombinator.com/" ) ;
104
+ expect ( url . startsWith ( "https://edge.capture.page/" ) ) . toBe ( true ) ;
105
+ } ) ;
106
+ } ) ;
0 commit comments