flexysnap 0.5.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/index.js +2 -1
- package/src/testUtils.js +14 -1
package/package.json
CHANGED
package/src/index.js
CHANGED
package/src/testUtils.js
CHANGED
|
@@ -41,6 +41,12 @@ function setBaseUrl(url) {
|
|
|
41
41
|
baseUrl = url;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
+
let cacheableUrlPatterns = ['/wp-content/', '/wp-includes/']
|
|
45
|
+
|
|
46
|
+
function setCacheableUrlPattern(pattern) {
|
|
47
|
+
cacheableUrlPatterns.push(pattern)
|
|
48
|
+
}
|
|
49
|
+
|
|
44
50
|
test.beforeEach(async ({ context }) => {
|
|
45
51
|
startTimer();
|
|
46
52
|
logTimestamp('Test execution started');
|
|
@@ -48,6 +54,12 @@ test.beforeEach(async ({ context }) => {
|
|
|
48
54
|
const req = route.request();
|
|
49
55
|
const url = new URL(req.url());
|
|
50
56
|
const path = url.pathname.toLowerCase();
|
|
57
|
+
|
|
58
|
+
for (let pattern of cacheableUrlPatterns) {
|
|
59
|
+
if (path.includes(pattern))
|
|
60
|
+
return route.continue();
|
|
61
|
+
}
|
|
62
|
+
|
|
51
63
|
if (req.method() !== 'GET' || path.includes('/wp-content/') || !url.href.includes(baseUrl)) {
|
|
52
64
|
return route.continue();
|
|
53
65
|
}
|
|
@@ -240,5 +252,6 @@ export {
|
|
|
240
252
|
setClosePopups,
|
|
241
253
|
callClosePopups,
|
|
242
254
|
logTimestamp,
|
|
243
|
-
setBaseUrl
|
|
255
|
+
setBaseUrl,
|
|
256
|
+
setCacheableUrlPattern
|
|
244
257
|
};
|