@@ -82,6 +82,7 @@ const REPOSITORY_DATA = {
82
82
forkCount :0 ,
83
83
starCount :1 ,
84
84
} ;
85
+ const CACHE_BURST_STRING = `v=${ new Date ( ) . getTime ( ) } ` ;
85
86
86
87
describe ( "Fetch Cards" , ( ) => {
87
88
let VERCEL_PREVIEW_URL ;
@@ -104,7 +105,7 @@ describe("Fetch Cards", () => {
104
105
105
106
// Get the Vercel preview stats card response.
106
107
const serverStatsSvg = await axios . get (
107
- `${ VERCEL_PREVIEW_URL } /api?username=${ USER } ` ,
108
+ `${ VERCEL_PREVIEW_URL } /api?username=${ USER } & ${ CACHE_BURST_STRING } ` ,
108
109
) ;
109
110
110
111
// Check if stats card from deployment matches the stats card from local.
@@ -115,16 +116,21 @@ describe("Fetch Cards", () => {
115
116
expect ( VERCEL_PREVIEW_URL ) . toBeDefined ( ) ;
116
117
117
118
// Check if the Vercel preview instance language card function is up and running.
119
+ console . log (
120
+ `${ VERCEL_PREVIEW_URL } /api/top-langs/?username=${ USER } &${ CACHE_BURST_STRING } ` ,
121
+ ) ;
118
122
await expect (
119
- axios . get ( `${ VERCEL_PREVIEW_URL } /api/top-langs/?username=${ USER } ` ) ,
123
+ axios . get (
124
+ `${ VERCEL_PREVIEW_URL } /api/top-langs/?username=${ USER } &${ CACHE_BURST_STRING } ` ,
125
+ ) ,
120
126
) . resolves . not . toThrow ( ) ;
121
127
122
128
// Get local language card.
123
129
const localLanguageCardSVG = renderTopLanguages ( LANGS_DATA ) ;
124
130
125
131
// Get the Vercel preview language card response.
126
132
const severLanguageSVG = await axios . get (
127
- `${ VERCEL_PREVIEW_URL } /api/top-langs/?username=${ USER } ` ,
133
+ `${ VERCEL_PREVIEW_URL } /api/top-langs/?username=${ USER } & ${ CACHE_BURST_STRING } ` ,
128
134
) ;
129
135
130
136
// Check if language card from deployment matches the local language card.
@@ -144,7 +150,7 @@ describe("Fetch Cards", () => {
144
150
145
151
// Get the Vercel preview WakaTime card response.
146
152
const serverWakaTimeSvg = await axios . get (
147
- `${ VERCEL_PREVIEW_URL } /api/wakatime?username=${ USER } ` ,
153
+ `${ VERCEL_PREVIEW_URL } /api/wakatime?username=${ USER } & ${ CACHE_BURST_STRING } ` ,
148
154
) ;
149
155
150
156
// Check if WakaTime card from deployment matches the local WakaTime card.
@@ -156,15 +162,17 @@ describe("Fetch Cards", () => {
156
162
157
163
// Check if the Vercel preview instance Repo function is up and running.
158
164
await expect (
159
- axios . get ( `${ VERCEL_PREVIEW_URL } /api/pin/?username=${ USER } &repo=${ REPO } ` ) ,
165
+ axios . get (
166
+ `${ VERCEL_PREVIEW_URL } /api/pin/?username=${ USER } &repo=${ REPO } &${ CACHE_BURST_STRING } ` ,
167
+ ) ,
160
168
) . resolves . not . toThrow ( ) ;
161
169
162
170
// Get local repo card.
163
171
const localRepoCardSVG = renderRepoCard ( REPOSITORY_DATA ) ;
164
172
165
173
// Get the Vercel preview repo card response.
166
174
const serverRepoSvg = await axios . get (
167
- `${ VERCEL_PREVIEW_URL } /api/pin/?username=${ USER } &repo=${ REPO } ` ,
175
+ `${ VERCEL_PREVIEW_URL } /api/pin/?username=${ USER } &repo=${ REPO } & ${ CACHE_BURST_STRING } ` ,
168
176
) ;
169
177
170
178
// Check if Repo card from deployment matches the local Repo card.