@faststore/core 4.11.4-dev.4 → 4.11.4-dev.5
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.
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
|
|
2
|
-
> @faststore/core@4.11.4-dev.
|
|
2
|
+
> @faststore/core@4.11.4-dev.4 generate /home/runner/work/faststore/faststore/packages/core
|
|
3
3
|
> pnpm run gen-types && pnpm run cache-graphql
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
> @faststore/core@4.11.4-dev.
|
|
6
|
+
> @faststore/core@4.11.4-dev.4 gen-types /home/runner/work/faststore/faststore/packages/core
|
|
7
7
|
> node ../cli/bin/run generate-types .
|
|
8
8
|
|
|
9
9
|
[33m[STARTED][39m Parse Configuration
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
[32m[COMPLETED][39m Generate to @generated/
|
|
20
20
|
[32m[COMPLETED][39m Generate outputs
|
|
21
21
|
|
|
22
|
-
> @faststore/core@4.11.4-dev.
|
|
22
|
+
> @faststore/core@4.11.4-dev.4 cache-graphql /home/runner/work/faststore/faststore/packages/core
|
|
23
23
|
> node ../cli/bin/run cache-graphql --config=./discovery.config.default.js --queries=./@generated/persisted-documents.json
|
|
24
24
|
|
|
25
25
|
[Info] - Config file location: /home/runner/work/faststore/faststore/packages/core/discovery.config.default.js
|
package/.turbo/turbo-test.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @faststore/core@4.11.4-dev.
|
|
2
|
+
> @faststore/core@4.11.4-dev.4 test /home/runner/work/faststore/faststore/packages/core
|
|
3
3
|
> vitest run
|
|
4
4
|
|
|
5
5
|
|
|
@@ -7,28 +7,25 @@
|
|
|
7
7
|
|
|
8
8
|
Not implemented: navigation to another Document
|
|
9
9
|
Not implemented: navigation to another Document
|
|
10
|
-
[32m✓[39m [30m[46m browser [49m[39m test/sdk/ui/useScrollRestoration.browser.test.ts [2m([22m[2m43 tests[22m[2m)[22m[33m
|
|
10
|
+
[32m✓[39m [30m[46m browser [49m[39m test/sdk/ui/useScrollRestoration.browser.test.ts [2m([22m[2m43 tests[22m[2m)[22m[33m 787[2mms[22m[39m
|
|
11
11
|
Browserslist: browsers data (caniuse-lite) is 9 months old. Please run:
|
|
12
12
|
npx update-browserslist-db@latest
|
|
13
13
|
Why you should do it regularly: https://github.com/browserslist/update-db#readme
|
|
14
|
-
[32m✓[39m [30m[46m browser [49m[39m test/components/account/
|
|
15
|
-
[33m[2m✓[22m[39m shows
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
[33m[2m✓[22m[39m
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
[32m✓[39m [30m[46m browser [49m[39m test/
|
|
25
|
-
[32m✓[39m [30m[46m browser [49m[39m test/
|
|
26
|
-
|
|
27
|
-
[32m✓[39m [30m[46m browser [49m[39m test/sdk/
|
|
28
|
-
[32m✓[39m [30m[46m browser [49m[39m test/components/
|
|
29
|
-
[32m✓[39m [30m[46m browser [49m[39m test/sdk/session/reconcileSessionLocale.browser.test.ts [2m([22m[2m6 tests[22m[2m)[22m[32m 10[2mms[22m[39m
|
|
30
|
-
[32m✓[39m [30m[46m browser [49m[39m test/components/ui/ProductGallery/GalleryPageHeightLock.browser.test.tsx [2m([22m[2m8 tests[22m[2m)[22m[32m 93[2mms[22m[39m
|
|
31
|
-
[32m✓[39m [30m[46m browser [49m[39m test/sdk/recommendations/useRecommendationShelf.browser.test.tsx [2m([22m[2m12 tests[22m[2m)[22m[32m 84[2mms[22m[39m
|
|
14
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/account/ContractSwitcher.browser.test.tsx [2m([22m[2m22 tests[22m[2m)[22m[33m 2308[2mms[22m[39m
|
|
15
|
+
[33m[2m✓[22m[39m shows an error state when the list fails to load [33m 510[2mms[22m[39m
|
|
16
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/account/cards/MyAccountListCards.browser.test.tsx [2m([22m[2m16 tests[22m[2m)[22m[33m 1713[2mms[22m[39m
|
|
17
|
+
[33m[2m✓[22m[39m shows the tab bar and renders Personal cards by default [33m 1004[2mms[22m[39m
|
|
18
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/account/orders/BuyingPolicyAlert.browser.test.tsx [2m([22m[2m13 tests[22m[2m)[22m[33m 2382[2mms[22m[39m
|
|
19
|
+
[33m[2m✓[22m[39m opens the reject confirmation modal with the default English copy [33m 1002[2mms[22m[39m
|
|
20
|
+
[33m[2m✓[22m[39m opens the reject confirmation modal with CMS-provided labels [33m 307[2mms[22m[39m
|
|
21
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/ui/RichText/RichText.browser.test.tsx [2m([22m[2m8 tests[22m[2m)[22m[33m 314[2mms[22m[39m
|
|
22
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/account/OrganizationDrawer.browser.test.tsx [2m([22m[2m10 tests[22m[2m)[22m[33m 1727[2mms[22m[39m
|
|
23
|
+
[33m[2m✓[22m[39m renders the menu view with contract details and manage footer [33m 898[2mms[22m[39m
|
|
24
|
+
[32m✓[39m [30m[46m browser [49m[39m test/sdk/product/usePageProductsQuery.browser.test.ts [2m([22m[2m9 tests[22m[2m)[22m[32m 83[2mms[22m[39m
|
|
25
|
+
[32m✓[39m [30m[46m browser [49m[39m test/sdk/localization/useBindingSelector.browser.test.tsx [2m([22m[2m9 tests[22m[2m)[22m[32m 40[2mms[22m[39m
|
|
26
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/CartRecommendationShelf/CartRecommendationShelf.browser.test.tsx [2m([22m[2m13 tests[22m[2m)[22m[32m 118[2mms[22m[39m
|
|
27
|
+
[32m✓[39m [30m[46m browser [49m[39m test/sdk/session/reconcileSessionLocale.browser.test.ts [2m([22m[2m6 tests[22m[2m)[22m[32m 14[2mms[22m[39m
|
|
28
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/ui/ProductGallery/GalleryPageHeightLock.browser.test.tsx [2m([22m[2m8 tests[22m[2m)[22m[32m 58[2mms[22m[39m
|
|
32
29
|
[90mstderr[2m | test/components/RecommendationShelf/RecommendationShelf.browser.test.tsx
|
|
33
30
|
[22m[39mError in optimistic validation: TypeError: Failed to parse URL from /api/graphql?operationName=ValidateCartMutation&operationHash=3c71b0d3fc2bade14df68abfa271858beb361b12
|
|
34
31
|
[90m at node:internal/deps/undici/undici:16416:13[39m
|
|
@@ -58,12 +55,22 @@ Browserslist: browsers data (caniuse-lite) is 9 months old. Please run:
|
|
|
58
55
|
[90mstderr[2m | test/components/RecommendationShelf/RecommendationShelf.browser.test.tsx[2m > [22m[2mRecommendationShelf[2m > [22m[2mrenders nothing when there is an error
|
|
59
56
|
[22m[39mError fetching recommendations [90mundefined[39m boom for campaign vrn:recommendations:acc:rec-top-items-v2:campaign-1
|
|
60
57
|
|
|
61
|
-
[32m✓[39m [30m[46m browser [49m[39m test/components/RecommendationShelf/RecommendationShelf.browser.test.tsx [2m([22m[2m8 tests[22m[2m)[22m[32m
|
|
62
|
-
[32m✓[39m [30m[46m browser [49m[39m test/sdk/
|
|
63
|
-
[32m✓[39m [30m[46m browser [49m[39m test/
|
|
64
|
-
[32m✓[39m [30m[46m browser [49m[39m test/components/CartSidebar/CartSidebar.browser.test.tsx [2m([22m[2m5 tests[22m[2m)[22m[32m
|
|
65
|
-
[32m✓[39m [30m[46m browser [49m[39m test/sdk/session/getInitialSession.browser.test.ts [2m([22m[2m7 tests[22m[2m)[22m[32m
|
|
66
|
-
[32m✓[39m [30m[46m browser [49m[39m test/components/
|
|
58
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/RecommendationShelf/RecommendationShelf.browser.test.tsx [2m([22m[2m8 tests[22m[2m)[22m[32m 124[2mms[22m[39m
|
|
59
|
+
[32m✓[39m [30m[46m browser [49m[39m test/sdk/recommendations/useRecommendationShelf.browser.test.tsx [2m([22m[2m12 tests[22m[2m)[22m[32m 43[2mms[22m[39m
|
|
60
|
+
[32m✓[39m [30m[46m browser [49m[39m test/sdk/product/useProductQuery.browser.test.ts [2m([22m[2m5 tests[22m[2m)[22m[33m 313[2mms[22m[39m
|
|
61
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/CartSidebar/CartSidebar.browser.test.tsx [2m([22m[2m5 tests[22m[2m)[22m[32m 75[2mms[22m[39m
|
|
62
|
+
[32m✓[39m [30m[46m browser [49m[39m test/sdk/session/getInitialSession.browser.test.ts [2m([22m[2m7 tests[22m[2m)[22m[32m 12[2mms[22m[39m
|
|
63
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/sections/Account/AccountOrderDetails.browser.test.tsx [2m([22m[2m4 tests[22m[2m)[22m[32m 101[2mms[22m[39m
|
|
64
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/navigation/Navbar.browser.test.tsx [2m([22m[2m3 tests[22m[2m)[22m[32m 98[2mms[22m[39m
|
|
65
|
+
[90mstderr[2m | test/sdk/session/validateSession.browser.test.ts
|
|
66
|
+
[22m[39mError in optimistic validation: TypeError: Cannot read properties of undefined (reading 'read')
|
|
67
|
+
at waitForSessionValidated [90m(/home/runner/work/faststore/faststore/packages/core/[39msrc/sdk/cart/waitForSessionValidated.ts:16:32[90m)[39m
|
|
68
|
+
at validateCart [90m(/home/runner/work/faststore/faststore/packages/core/[39msrc/sdk/cart/index.ts:124:9[90m)[39m
|
|
69
|
+
at onValidate [90m(/home/runner/work/faststore/faststore/packages/core/[39msrc/sdk/useStore.ts:18:20[90m)[39m
|
|
70
|
+
at a (/home/runner/work/faststore/faststore/packages/sdk/dist/es/index.mjs:357:23)
|
|
71
|
+
[90m at processTicksAndRejections (node:internal/process/task_queues:103:5)[39m
|
|
72
|
+
|
|
73
|
+
[32m✓[39m [30m[46m browser [49m[39m test/sdk/session/validateSession.browser.test.ts [2m([22m[2m9 tests[22m[2m)[22m[32m 21[2mms[22m[39m
|
|
67
74
|
[90mstderr[2m | test/pages/password-protection.browser.test.tsx[2m > [22m[2mPasswordProtectionLogin[2m > [22m[2mposts the password and redirects to the requested return path
|
|
68
75
|
[22m[39mWarning: An update to PasswordProtectionLogin inside a test was not wrapped in act(...).
|
|
69
76
|
|
|
@@ -293,19 +300,11 @@ act(() => {
|
|
|
293
300
|
This ensures that you're testing the behavior the user would see in the browser. Learn more at https://reactjs.org/link/wrap-tests-with-act
|
|
294
301
|
at PasswordProtectionLogin (/home/runner/work/faststore/faststore/packages/core/src/pages/password-protection/index.tsx:19:69)
|
|
295
302
|
|
|
296
|
-
[32m✓[39m [30m[46m browser [49m[39m test/pages/password-protection.browser.test.tsx [2m([22m[2m6 tests[22m[2m)[22m[33m
|
|
297
|
-
[33m[2m✓[22m[39m renders the password protection form [33m
|
|
298
|
-
[
|
|
299
|
-
[22m[
|
|
300
|
-
|
|
301
|
-
at validateCart [90m(/home/runner/work/faststore/faststore/packages/core/[39msrc/sdk/cart/index.ts:124:9[90m)[39m
|
|
302
|
-
at onValidate [90m(/home/runner/work/faststore/faststore/packages/core/[39msrc/sdk/useStore.ts:18:20[90m)[39m
|
|
303
|
-
at a (/home/runner/work/faststore/faststore/packages/sdk/dist/es/index.mjs:357:23)
|
|
304
|
-
[90m at processTicksAndRejections (node:internal/process/task_queues:103:5)[39m
|
|
305
|
-
|
|
306
|
-
[32m✓[39m [30m[46m browser [49m[39m test/sdk/session/validateSession.browser.test.ts [2m([22m[2m9 tests[22m[2m)[22m[32m 22[2mms[22m[39m
|
|
307
|
-
[32m✓[39m [30m[46m browser [49m[39m test/components/account/OrganizationDrawerFooter.browser.test.tsx [2m([22m[2m8 tests[22m[2m)[22m[33m 824[2mms[22m[39m
|
|
308
|
-
[33m[2m✓[22m[39m shows manage link for organization managers [33m 501[2mms[22m[39m
|
|
303
|
+
[32m✓[39m [30m[46m browser [49m[39m test/pages/password-protection.browser.test.tsx [2m([22m[2m6 tests[22m[2m)[22m[33m 1035[2mms[22m[39m
|
|
304
|
+
[33m[2m✓[22m[39m renders the password protection form [33m 456[2mms[22m[39m
|
|
305
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/account/OrganizationDrawerFooter.browser.test.tsx [2m([22m[2m8 tests[22m[2m)[22m[33m 597[2mms[22m[39m
|
|
306
|
+
[33m[2m✓[22m[39m shows manage link for organization managers [33m 316[2mms[22m[39m
|
|
307
|
+
[32m✓[39m [30m[46m browser [49m[39m test/sdk/account/useSwitchContract.browser.test.ts [2m([22m[2m5 tests[22m[2m)[22m[32m 80[2mms[22m[39m
|
|
309
308
|
[90mstderr[2m | test/components/cms/RenderSections.browser.test.tsx
|
|
310
309
|
[22m[39mError in optimistic validation: TypeError: Cannot read properties of undefined (reading 'read')
|
|
311
310
|
at waitForSessionValidated [90m(/home/runner/work/faststore/faststore/packages/core/[39msrc/sdk/cart/waitForSessionValidated.ts:16:32[90m)[39m
|
|
@@ -314,10 +313,9 @@ This ensures that you're testing the behavior the user would see in the browser.
|
|
|
314
313
|
at a (/home/runner/work/faststore/faststore/packages/sdk/dist/es/index.mjs:357:23)
|
|
315
314
|
[90m at processTicksAndRejections (node:internal/process/task_queues:103:5)[39m
|
|
316
315
|
|
|
317
|
-
[32m✓[39m [30m[46m browser [49m[39m test/
|
|
318
|
-
[32m✓[39m [30m[46m browser [49m[39m test/components/
|
|
319
|
-
[32m✓[39m [30m[46m browser [49m[39m test/sdk/product/usePageProductsQuery.deliveryPromise.browser.test.ts [2m([22m[2m3 tests[22m[2m)[22m[32m
|
|
320
|
-
[32m✓[39m [30m[46m browser [49m[39m test/components/navigation/NavbarSlider.browser.test.tsx [2m([22m[2m2 tests[22m[2m)[22m[32m 28[2mms[22m[39m
|
|
316
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/cms/RenderSections.browser.test.tsx [2m([22m[2m5 tests[22m[2m)[22m[32m 79[2mms[22m[39m
|
|
317
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/navigation/NavbarSlider.browser.test.tsx [2m([22m[2m2 tests[22m[2m)[22m[32m 33[2mms[22m[39m
|
|
318
|
+
[32m✓[39m [30m[46m browser [49m[39m test/sdk/product/usePageProductsQuery.deliveryPromise.browser.test.ts [2m([22m[2m3 tests[22m[2m)[22m[32m 29[2mms[22m[39m
|
|
321
319
|
[90mstderr[2m | test/sdk/localization/store-url.browser.test.ts
|
|
322
320
|
[22m[39mError in optimistic validation: TypeError: Cannot read properties of undefined (reading 'read')
|
|
323
321
|
at waitForSessionValidated [90m(/home/runner/work/faststore/faststore/packages/core/[39msrc/sdk/cart/waitForSessionValidated.ts:16:32[90m)[39m
|
|
@@ -326,9 +324,9 @@ This ensures that you're testing the behavior the user would see in the browser.
|
|
|
326
324
|
at a (/home/runner/work/faststore/faststore/packages/sdk/dist/es/index.mjs:357:23)
|
|
327
325
|
[90m at processTicksAndRejections (node:internal/process/task_queues:103:5)[39m
|
|
328
326
|
|
|
329
|
-
[32m✓[39m [30m[46m browser [49m[39m test/sdk/localization/store-url.browser.test.ts [2m([22m[2m3 tests[22m[2m)[22m[32m
|
|
330
|
-
[32m✓[39m [30m[46m browser [49m[39m test/components/account/Menu.browser.test.tsx [2m([22m[2m6 tests[22m[2m)[22m[32m
|
|
331
|
-
[32m✓[39m [30m[46m browser [49m[39m test/sdk/account/useAvailableContracts.browser.test.ts [2m([22m[2m6 tests[22m[2m)[22m[32m
|
|
327
|
+
[32m✓[39m [30m[46m browser [49m[39m test/sdk/localization/store-url.browser.test.ts [2m([22m[2m3 tests[22m[2m)[22m[32m 4[2mms[22m[39m
|
|
328
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/account/Menu.browser.test.tsx [2m([22m[2m6 tests[22m[2m)[22m[32m 266[2mms[22m[39m
|
|
329
|
+
[32m✓[39m [30m[46m browser [49m[39m test/sdk/account/useAvailableContracts.browser.test.ts [2m([22m[2m6 tests[22m[2m)[22m[32m 34[2mms[22m[39m
|
|
332
330
|
[90mstderr[2m | test/sdk/session/refreshTokenRoute.browser.test.ts
|
|
333
331
|
[22m[39mError in optimistic validation: TypeError: Cannot read properties of undefined (reading 'read')
|
|
334
332
|
at waitForSessionValidated [90m(/home/runner/work/faststore/faststore/packages/core/[39msrc/sdk/cart/waitForSessionValidated.ts:16:32[90m)[39m
|
|
@@ -337,13 +335,13 @@ This ensures that you're testing the behavior the user would see in the browser.
|
|
|
337
335
|
at a (/home/runner/work/faststore/faststore/packages/sdk/dist/es/index.mjs:357:23)
|
|
338
336
|
[90m at processTicksAndRejections (node:internal/process/task_queues:103:5)[39m
|
|
339
337
|
|
|
340
|
-
[32m✓[39m [30m[46m browser [49m[39m test/
|
|
341
|
-
[32m✓[39m [30m[46m browser [49m[39m test/
|
|
342
|
-
[32m✓[39m [30m[46m browser [49m[39m test/sdk/recommendations/useRecommendationShelf.sessionFallback.browser.test.tsx [2m([22m[2m2 tests[22m[2m)[22m[32m
|
|
343
|
-
[32m✓[39m [30m[46m browser [49m[39m test/components/
|
|
344
|
-
[32m✓[39m [30m[46m browser [49m[39m test/components/
|
|
345
|
-
[32m✓[39m [30m[46m browser [49m[39m test/components/sections/Account/AccountListQuotes.browser.test.tsx [2m([22m[2m4 tests[22m[2m)[22m[32m
|
|
346
|
-
[32m✓[39m [30m[46m browser [49m[39m test/sdk/account/changeContractToken.browser.test.ts [2m([22m[2m9 tests[22m[2m)[22m[32m
|
|
338
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/templates/SearchPage/SearchWrapper.browser.test.tsx [2m([22m[2m3 tests[22m[2m)[22m[32m 41[2mms[22m[39m
|
|
339
|
+
[32m✓[39m [30m[46m browser [49m[39m test/sdk/session/refreshTokenRoute.browser.test.ts [2m([22m[2m3 tests[22m[2m)[22m[32m 7[2mms[22m[39m
|
|
340
|
+
[32m✓[39m [30m[46m browser [49m[39m test/sdk/recommendations/useRecommendationShelf.sessionFallback.browser.test.tsx [2m([22m[2m2 tests[22m[2m)[22m[32m 126[2mms[22m[39m
|
|
341
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/navigation/NavbarAccountArea.browser.test.tsx [2m([22m[2m4 tests[22m[2m)[22m[32m 50[2mms[22m[39m
|
|
342
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/CartRecommendationShelf/CartRecommendationProductCard.browser.test.tsx [2m([22m[2m3 tests[22m[2m)[22m[32m 43[2mms[22m[39m
|
|
343
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/sections/Account/AccountListQuotes.browser.test.tsx [2m([22m[2m4 tests[22m[2m)[22m[32m 94[2mms[22m[39m
|
|
344
|
+
[32m✓[39m [30m[46m browser [49m[39m test/sdk/account/changeContractToken.browser.test.ts [2m([22m[2m9 tests[22m[2m)[22m[32m 16[2mms[22m[39m
|
|
347
345
|
[90mstderr[2m | test/components/account/doLogout.browser.test.ts
|
|
348
346
|
[22m[39mError in optimistic validation: TypeError: Cannot read properties of undefined (reading 'read')
|
|
349
347
|
at waitForSessionValidated [90m(/home/runner/work/faststore/faststore/packages/core/[39msrc/sdk/cart/waitForSessionValidated.ts:16:32[90m)[39m
|
|
@@ -352,11 +350,11 @@ This ensures that you're testing the behavior the user would see in the browser.
|
|
|
352
350
|
at a (/home/runner/work/faststore/faststore/packages/sdk/dist/es/index.mjs:357:23)
|
|
353
351
|
[90m at processTicksAndRejections (node:internal/process/task_queues:103:5)[39m
|
|
354
352
|
|
|
355
|
-
[32m✓[39m [30m[46m browser [49m[39m test/components/account/doLogout.browser.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m
|
|
356
|
-
[32m✓[39m [30m[46m browser [49m[39m test/components/account/OrganizationDrawerHeader.browser.test.tsx [2m([22m[2m5 tests[22m[2m)[22m[32m
|
|
357
|
-
[32m✓[39m [30m[46m browser [49m[39m test/sdk/product/useProductNotFoundRedirect.browser.test.ts [2m([22m[2m7 tests[22m[2m)[22m[32m
|
|
358
|
-
[32m✓[39m [30m[46m browser [49m[39m test/sdk/account/useRefreshToken.browser.test.ts [2m([22m[2m4 tests[22m[2m)[22m[32m
|
|
359
|
-
[32m✓[39m [30m[46m browser [49m[39m test/components/ui/LocalizationButton.browser.test.tsx [2m([22m[2m3 tests[22m[2m)[22m[32m
|
|
353
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/account/doLogout.browser.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m 27[2mms[22m[39m
|
|
354
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/account/OrganizationDrawerHeader.browser.test.tsx [2m([22m[2m5 tests[22m[2m)[22m[32m 270[2mms[22m[39m
|
|
355
|
+
[32m✓[39m [30m[46m browser [49m[39m test/sdk/product/useProductNotFoundRedirect.browser.test.ts [2m([22m[2m7 tests[22m[2m)[22m[32m 23[2mms[22m[39m
|
|
356
|
+
[32m✓[39m [30m[46m browser [49m[39m test/sdk/account/useRefreshToken.browser.test.ts [2m([22m[2m4 tests[22m[2m)[22m[32m 135[2mms[22m[39m
|
|
357
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/ui/LocalizationButton.browser.test.tsx [2m([22m[2m3 tests[22m[2m)[22m[32m 35[2mms[22m[39m
|
|
360
358
|
[90mstderr[2m | test/sdk/account/clearPersistedSessionState.browser.test.ts
|
|
361
359
|
[22m[39mError in optimistic validation: TypeError: Cannot read properties of undefined (reading 'read')
|
|
362
360
|
at waitForSessionValidated [90m(/home/runner/work/faststore/faststore/packages/core/[39msrc/sdk/cart/waitForSessionValidated.ts:16:32[90m)[39m
|
|
@@ -365,15 +363,14 @@ This ensures that you're testing the behavior the user would see in the browser.
|
|
|
365
363
|
at a (/home/runner/work/faststore/faststore/packages/sdk/dist/es/index.mjs:357:23)
|
|
366
364
|
[90m at processTicksAndRejections (node:internal/process/task_queues:103:5)[39m
|
|
367
365
|
|
|
368
|
-
[32m✓[39m [30m[46m browser [49m[39m test/components/account/OrganizationSignInButton.browser.test.tsx [2m([22m[2m4 tests[22m[2m)[22m[32m
|
|
369
|
-
[32m✓[39m [30m[46m browser [49m[39m test/sdk/account/clearPersistedSessionState.browser.test.ts [2m([22m[2m4 tests[22m[2m)[22m[32m
|
|
370
|
-
[32m✓[39m [30m[46m browser [49m[39m test/components/sections/Account/AccountOrderDelivery.browser.test.tsx [2m([22m[2m2 tests[22m[2m)[22m[32m
|
|
371
|
-
[32m✓[39m [30m[46m browser [49m[39m test/components/account/orders/DeliveryOptionAccordion.browser.test.tsx [2m([22m[2m2 tests[22m[2m)[22m[32m
|
|
372
|
-
[32m✓[39m [30m[46m browser [49m[39m test/components/sections/Account/AccountOrderStatus.browser.test.tsx [2m([22m[2m3 tests[22m[2m)[22m[32m
|
|
373
|
-
[32m✓[39m [30m[46m browser [49m[39m test/components/sections/Account/AccountListCards.browser.test.tsx [2m([22m[2m3 tests[22m[2m)[22m[32m
|
|
374
|
-
[32m✓[39m [30m[46m browser [49m[39m test/components/region/useRegion.browser.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m
|
|
375
|
-
[32m✓[39m [30m[46m browser [49m[39m test/components/sections/Account/AccountOrdersList.browser.test.tsx [2m([22m[2m2 tests[22m[2m)[22m[32m
|
|
376
|
-
[32m✓[39m [30m[46m browser [49m[39m test/components/account/orders/SummaryCard.browser.test.tsx [2m([22m[2m2 tests[22m[2m)[22m[32m 100[2mms[22m[39m
|
|
366
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/account/OrganizationSignInButton.browser.test.tsx [2m([22m[2m4 tests[22m[2m)[22m[32m 217[2mms[22m[39m
|
|
367
|
+
[32m✓[39m [30m[46m browser [49m[39m test/sdk/account/clearPersistedSessionState.browser.test.ts [2m([22m[2m4 tests[22m[2m)[22m[32m 17[2mms[22m[39m
|
|
368
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/sections/Account/AccountOrderDelivery.browser.test.tsx [2m([22m[2m2 tests[22m[2m)[22m[32m 73[2mms[22m[39m
|
|
369
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/account/orders/DeliveryOptionAccordion.browser.test.tsx [2m([22m[2m2 tests[22m[2m)[22m[32m 63[2mms[22m[39m
|
|
370
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/sections/Account/AccountOrderStatus.browser.test.tsx [2m([22m[2m3 tests[22m[2m)[22m[32m 79[2mms[22m[39m
|
|
371
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/sections/Account/AccountListCards.browser.test.tsx [2m([22m[2m3 tests[22m[2m)[22m[32m 67[2mms[22m[39m
|
|
372
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/region/useRegion.browser.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m 15[2mms[22m[39m
|
|
373
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/sections/Account/AccountOrdersList.browser.test.tsx [2m([22m[2m2 tests[22m[2m)[22m[32m 20[2mms[22m[39m
|
|
377
374
|
[90mstderr[2m | test/sdk/session/sessionStore.browser.test.ts
|
|
378
375
|
[22m[39mError in optimistic validation: TypeError: Cannot read properties of undefined (reading 'read')
|
|
379
376
|
at waitForSessionValidated [90m(/home/runner/work/faststore/faststore/packages/core/[39msrc/sdk/cart/waitForSessionValidated.ts:16:32[90m)[39m
|
|
@@ -382,9 +379,10 @@ This ensures that you're testing the behavior the user would see in the browser.
|
|
|
382
379
|
at a (/home/runner/work/faststore/faststore/packages/sdk/dist/es/index.mjs:357:23)
|
|
383
380
|
[90m at processTicksAndRejections (node:internal/process/task_queues:103:5)[39m
|
|
384
381
|
|
|
385
|
-
[32m✓[39m [30m[46m browser [49m[39m test/sdk/session/sessionStore.browser.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m
|
|
386
|
-
[32m✓[39m [30m[46m browser [49m[39m test/components/account/orders/
|
|
387
|
-
[32m✓[39m [30m[46m browser [49m[39m test/
|
|
382
|
+
[32m✓[39m [30m[46m browser [49m[39m test/sdk/session/sessionStore.browser.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m 4[2mms[22m[39m
|
|
383
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/account/orders/SummaryCard.browser.test.tsx [2m([22m[2m2 tests[22m[2m)[22m[32m 47[2mms[22m[39m
|
|
384
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/account/orders/DeliveryOptionAccordionDeliveryInfo.browser.test.tsx [2m([22m[2m1 test[22m[2m)[22m[32m 33[2mms[22m[39m
|
|
385
|
+
[32m✓[39m [30m[46m browser [49m[39m test/utils/shouldBypassRefreshToken.browser.test.ts [2m([22m[2m5 tests[22m[2m)[22m[32m 5[2mms[22m[39m
|
|
388
386
|
[90mstderr[2m | test/sdk/account/refreshToken.browser.test.ts
|
|
389
387
|
[22m[39mError in optimistic validation: TypeError: Cannot read properties of undefined (reading 'read')
|
|
390
388
|
at waitForSessionValidated [90m(/home/runner/work/faststore/faststore/packages/core/[39msrc/sdk/cart/waitForSessionValidated.ts:16:32[90m)[39m
|
|
@@ -393,19 +391,19 @@ This ensures that you're testing the behavior the user would see in the browser.
|
|
|
393
391
|
at a (/home/runner/work/faststore/faststore/packages/sdk/dist/es/index.mjs:357:23)
|
|
394
392
|
[90m at processTicksAndRejections (node:internal/process/task_queues:103:5)[39m
|
|
395
393
|
|
|
396
|
-
[32m✓[39m [30m[46m browser [49m[39m test/sdk/account/refreshToken.browser.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m
|
|
397
|
-
[32m✓[39m [30m[46m browser [49m[39m test/
|
|
398
|
-
[32m✓[39m [30m[46m browser [49m[39m test/
|
|
399
|
-
[32m✓[39m [30m[46m browser [49m[39m test/components/account/orders/DeliveryCard.browser.test.tsx [2m([22m[2m1 test[22m[2m)[22m[32m
|
|
400
|
-
[32m✓[39m [30m[46m browser [49m[39m test/components/account/orders/DeliveryOptionAccordionProducts.browser.test.tsx [2m([22m[2m1 test[22m[2m)[22m[32m
|
|
401
|
-
[32m✓[39m [30m[46m browser [49m[39m test/components/skeletons/ProductGridSkeleton.browser.test.tsx [2m([22m[2m2 tests[22m[2m)[22m[32m
|
|
402
|
-
[32m✓[39m [30m[43m node [49m[39m test/pages/api/switch-contract.test.ts [2m([22m[2m61 tests[22m[2m)[22m[32m
|
|
403
|
-
[32m✓[39m [30m[43m node [49m[39m test/utils/localization/bindingPaths.test.ts [2m([22m[2m71 tests[22m[2m)[22m[32m
|
|
404
|
-
[32m✓[39m [30m[46m browser [49m[39m test/components/account/orders/FilterFacetPendingApproval.browser.test.tsx [2m([22m[2m1 test[22m[2m)[22m[32m
|
|
405
|
-
[32m✓[39m [30m[43m node [49m[39m test/server/
|
|
406
|
-
[32m✓[39m [30m[43m node [49m[39m test/server/
|
|
407
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
408
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
394
|
+
[32m✓[39m [30m[46m browser [49m[39m test/sdk/account/refreshToken.browser.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m 3[2mms[22m[39m
|
|
395
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/account/orders/StatusCard.browser.test.tsx [2m([22m[2m2 tests[22m[2m)[22m[32m 77[2mms[22m[39m
|
|
396
|
+
[32m✓[39m [30m[46m browser [49m[39m test/sdk/session/reconcileSessionLocale.disabled.browser.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m 3[2mms[22m[39m
|
|
397
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/account/orders/DeliveryCard.browser.test.tsx [2m([22m[2m1 test[22m[2m)[22m[32m 37[2mms[22m[39m
|
|
398
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/account/orders/DeliveryOptionAccordionProducts.browser.test.tsx [2m([22m[2m1 test[22m[2m)[22m[32m 34[2mms[22m[39m
|
|
399
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/skeletons/ProductGridSkeleton.browser.test.tsx [2m([22m[2m2 tests[22m[2m)[22m[32m 30[2mms[22m[39m
|
|
400
|
+
[32m✓[39m [30m[43m node [49m[39m test/pages/api/switch-contract.test.ts [2m([22m[2m61 tests[22m[2m)[22m[32m 148[2mms[22m[39m
|
|
401
|
+
[32m✓[39m [30m[43m node [49m[39m test/utils/localization/bindingPaths.test.ts [2m([22m[2m71 tests[22m[2m)[22m[32m 15[2mms[22m[39m
|
|
402
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/account/orders/FilterFacetPendingApproval.browser.test.tsx [2m([22m[2m1 test[22m[2m)[22m[32m 149[2mms[22m[39m
|
|
403
|
+
[32m✓[39m [30m[43m node [49m[39m test/server/content/service.test.ts [2m([22m[2m32 tests[22m[2m)[22m[32m 33[2mms[22m[39m
|
|
404
|
+
[32m✓[39m [30m[43m node [49m[39m test/server/password-protection-service.test.ts [2m([22m[2m22 tests[22m[2m)[22m[32m 30[2mms[22m[39m
|
|
405
|
+
[32m✓[39m [30m[43m node [49m[39m test/server/cms/ResilientClientCMS.test.ts [2m([22m[2m24 tests[22m[2m)[22m[32m 99[2mms[22m[39m
|
|
406
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/localization/useBindingSelector.test.tsx [2m([22m[2m22 tests[22m[2m)[22m[32m 8[2mms[22m[39m
|
|
409
407
|
[90mstderr[2m | test/sdk/deliveryPromise/provider.effect.test.tsx[2m > [22m[2mDeliveryPromiseProvider pickup fetch[2m > [22m[2mclears the loading flag after a failed request and retries on the next update
|
|
410
408
|
[22m[39mFailed to fetch pickup points: Error: network
|
|
411
409
|
at [90m/home/runner/work/faststore/faststore/packages/core/[39mtest/sdk/deliveryPromise/provider.effect.test.tsx:250:30
|
|
@@ -432,7 +430,8 @@ This ensures that you're testing the behavior the user would see in the browser.
|
|
|
432
430
|
at trace (file:///home/runner/work/faststore/faststore/node_modules/[4m.pnpm[24m/vitest@4.0.18_@opentelemetry+api@1.9.0_@types+node@20.19.13_jiti@2.6.1_jsdom@27.4.0_sas_13be941c57d55f08f06eeaf1c180ddfe/node_modules/[4mvitest[24m/dist/chunks/test.B8ej_ZHS.js:239:21)
|
|
433
431
|
at runTest (file:///home/runner/work/faststore/faststore/node_modules/[4m.pnpm[24m/@vitest+runner@4.0.18/node_modules/[4m@vitest/runner[24m/dist/index.js:1653:12)
|
|
434
432
|
|
|
435
|
-
[32m✓[39m [30m[43m node [49m[39m test/sdk/deliveryPromise/provider.effect.test.tsx [2m([22m[2m9 tests[22m[2m)[22m[32m
|
|
433
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/deliveryPromise/provider.effect.test.tsx [2m([22m[2m9 tests[22m[2m)[22m[32m 68[2mms[22m[39m
|
|
434
|
+
[32m✓[39m [30m[43m node [49m[39m test/utils/match-url.test.ts [2m([22m[2m10 tests[22m[2m)[22m[32m 8[2mms[22m[39m
|
|
436
435
|
[90mstderr[2m | test/pages/api/graphql.test.ts[2m > [22m[2m/api/graphql error status propagation[2m > [22m[2mpropagates the upstream 400 from a wrapped BadRequestError instead of 500
|
|
437
436
|
[22m[39mGraphql execution returned with error: [
|
|
438
437
|
{
|
|
@@ -574,10 +573,10 @@ This ensures that you're testing the behavior the user would see in the browser.
|
|
|
574
573
|
extensions: { status: [33m401[39m, type: [32m'UnauthorizedError'[39m }
|
|
575
574
|
}
|
|
576
575
|
|
|
577
|
-
[32m✓[39m [30m[43m node [49m[39m test/pages/api/graphql.test.ts [2m([22m[2m30 tests[22m[2m)[22m[32m
|
|
578
|
-
[32m✓[39m [30m[43m node [49m[39m test/pages/api/unlock.test.ts [2m([22m[2m15 tests[22m[2m)[22m[32m
|
|
579
|
-
[32m✓[39m [30m[43m node [49m[39m test/sdk/session/syncSalesChannelFromOrderForm.test.ts [2m([22m[2m14 tests[22m[2m)[22m[32m
|
|
580
|
-
[32m✓[39m [30m[43m node [49m[39m test/sdk/localization/bindingSelector.test.ts [2m([22m[2m18 tests[22m[2m)[22m[32m
|
|
576
|
+
[32m✓[39m [30m[43m node [49m[39m test/pages/api/graphql.test.ts [2m([22m[2m30 tests[22m[2m)[22m[32m 29[2mms[22m[39m
|
|
577
|
+
[32m✓[39m [30m[43m node [49m[39m test/pages/api/unlock.test.ts [2m([22m[2m15 tests[22m[2m)[22m[32m 120[2mms[22m[39m
|
|
578
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/session/syncSalesChannelFromOrderForm.test.ts [2m([22m[2m14 tests[22m[2m)[22m[32m 9[2mms[22m[39m
|
|
579
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/localization/bindingSelector.test.ts [2m([22m[2m18 tests[22m[2m)[22m[32m 7[2mms[22m[39m
|
|
581
580
|
[90mstderr[2m | test/components/search/SearchInputComponent.test.tsx
|
|
582
581
|
[22m[39mWarning: forwardRef render functions accept exactly two parameters: props and ref. Did you forget to use the ref parameter?
|
|
583
582
|
|
|
@@ -651,64 +650,63 @@ Warning: React does not recognize the `providerProps` prop on a DOM element. If
|
|
|
651
650
|
at Suspense
|
|
652
651
|
at Wrapper (/home/runner/work/faststore/faststore/packages/core/test/components/search/SearchInputComponent.test.tsx:139:20)
|
|
653
652
|
|
|
654
|
-
[32m✓[39m [30m[43m node [49m[39m test/components/search/SearchInputComponent.test.tsx [2m([22m[2m8 tests[22m[2m)[22m[32m
|
|
655
|
-
[32m✓[39m [30m[43m node [49m[39m test/sdk/account/refreshToken.test.ts [2m([22m[2m21 tests[22m[2m)[22m[32m
|
|
656
|
-
[32m✓[39m [30m[43m node [49m[39m test/components/quotes/MyAccountListQuotesTable.test.tsx [2m([22m[2m15 tests[22m[2m)[22m[33m
|
|
657
|
-
[32m✓[39m [30m[43m node [49m[39m test/sdk/search/useSearchHistory.test.ts [2m([22m[2m13 tests[22m[2m)[22m[32m
|
|
653
|
+
[32m✓[39m [30m[43m node [49m[39m test/components/search/SearchInputComponent.test.tsx [2m([22m[2m8 tests[22m[2m)[22m[32m 183[2mms[22m[39m
|
|
654
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/account/refreshToken.test.ts [2m([22m[2m21 tests[22m[2m)[22m[32m 10[2mms[22m[39m
|
|
655
|
+
[32m✓[39m [30m[43m node [49m[39m test/components/quotes/MyAccountListQuotesTable.test.tsx [2m([22m[2m15 tests[22m[2m)[22m[33m 324[2mms[22m[39m
|
|
656
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/search/useSearchHistory.test.ts [2m([22m[2m13 tests[22m[2m)[22m[32m 35[2mms[22m[39m
|
|
658
657
|
[90mstderr[2m | test/pages/pvt/account/cards/index.test.ts[2m > [22m[2mCards page getServerSideProps[2m > [22m[2mredirects to /pvt/account/403 when the query fails with 401/403
|
|
659
658
|
[22m[39m{ extensions: { status: [33m401[39m } }
|
|
660
659
|
|
|
661
660
|
[90mstderr[2m | test/pages/pvt/account/cards/index.test.ts[2m > [22m[2mCards page getServerSideProps[2m > [22m[2mrenders the error state (no redirect) when the query fails with a non-auth status
|
|
662
661
|
[22m[39m{ extensions: { status: [33m502[39m } }
|
|
663
662
|
|
|
664
|
-
[32m✓[39m [30m[43m node [49m[39m test/pages/pvt/account/cards/index.test.ts [2m([22m[2m8 tests[22m[2m)[22m[32m
|
|
665
|
-
[32m✓[39m [30m[43m node [49m[39m test/components/quotes/quoteFilters.test.ts [2m([22m[2m26 tests[22m[2m)[22m[32m
|
|
666
|
-
[32m✓[39m [30m[43m node [49m[39m test/utils/productJsonLd.test.ts [2m([22m[2m36 tests[22m[2m)[22m[32m
|
|
667
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
668
|
-
|
|
669
|
-
[33m[2m✓[22m[39m navigates
|
|
670
|
-
|
|
671
|
-
[32m✓[39m [30m[43m node [49m[39m test/experimental/myAccountCmsServerSideProps.test.ts [2m([22m[2m5 tests[22m[2m)[22m[32m
|
|
672
|
-
[32m✓[39m [30m[43m node [49m[39m test/utils/clearCookies.test.ts [2m([22m[2m20 tests[22m[2m)[22m[32m
|
|
673
|
-
[32m✓[39m [30m[43m node [49m[39m test/utils/multipleTemplates.test.ts [2m([22m[2m8 tests[22m[2m)[22m[32m
|
|
663
|
+
[32m✓[39m [30m[43m node [49m[39m test/pages/pvt/account/cards/index.test.ts [2m([22m[2m8 tests[22m[2m)[22m[32m 6[2mms[22m[39m
|
|
664
|
+
[32m✓[39m [30m[43m node [49m[39m test/components/quotes/quoteFilters.test.ts [2m([22m[2m26 tests[22m[2m)[22m[32m 19[2mms[22m[39m
|
|
665
|
+
[32m✓[39m [30m[43m node [49m[39m test/utils/productJsonLd.test.ts [2m([22m[2m36 tests[22m[2m)[22m[32m 10[2mms[22m[39m
|
|
666
|
+
[32m✓[39m [30m[43m node [49m[39m test/utils/cookieCacheBusting.test.ts [2m([22m[2m10 tests[22m[2m)[22m[32m 10[2mms[22m[39m
|
|
667
|
+
[32m✓[39m [30m[43m node [49m[39m test/components/quotes/MyAccountListQuotes.test.tsx [2m([22m[2m11 tests[22m[2m)[22m[33m 802[2mms[22m[39m
|
|
668
|
+
[33m[2m✓[22m[39m navigates with the search term on blur [33m 358[2mms[22m[39m
|
|
669
|
+
[33m[2m✓[22m[39m navigates without a label param when the search is cleared [33m 360[2mms[22m[39m
|
|
670
|
+
[32m✓[39m [30m[43m node [49m[39m test/experimental/myAccountCmsServerSideProps.test.ts [2m([22m[2m5 tests[22m[2m)[22m[32m 8[2mms[22m[39m
|
|
671
|
+
[32m✓[39m [30m[43m node [49m[39m test/utils/clearCookies.test.ts [2m([22m[2m20 tests[22m[2m)[22m[32m 25[2mms[22m[39m
|
|
672
|
+
[32m✓[39m [30m[43m node [49m[39m test/utils/multipleTemplates.test.ts [2m([22m[2m8 tests[22m[2m)[22m[32m 6[2mms[22m[39m
|
|
674
673
|
[90mstderr[2m | test/sdk/account/useSetPassword.test.ts[2m > [22m[2museSetPassword[2m > [22m[2mmaps wrongcredentials error responses to the existing message
|
|
675
674
|
[22m[39mSet password request failed: Bad Request
|
|
676
675
|
|
|
677
|
-
[32m✓[39m [30m[43m node [49m[39m test/sdk/account/useSetPassword.test.ts [2m([22m[2m6 tests[22m[2m)[22m[32m
|
|
676
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/account/useSetPassword.test.ts [2m([22m[2m6 tests[22m[2m)[22m[32m 38[2mms[22m[39m
|
|
678
677
|
[32m✓[39m [30m[43m node [49m[39m test/sdk/orderEntry/useOrderEntryOperation.test.ts [2m([22m[2m8 tests[22m[2m)[22m[32m 36[2mms[22m[39m
|
|
679
|
-
[32m✓[39m [30m[43m node [49m[39m test/utils/localization/localizeRedirectDestination.test.ts [2m([22m[2m11 tests[22m[2m)[22m[32m
|
|
678
|
+
[32m✓[39m [30m[43m node [49m[39m test/utils/localization/localizeRedirectDestination.test.ts [2m([22m[2m11 tests[22m[2m)[22m[32m 4[2mms[22m[39m
|
|
680
679
|
[32m✓[39m [30m[43m node [49m[39m test/components/quotes/MyAccountQuotesFilterSlider.test.tsx [2m([22m[2m8 tests[22m[2m)[22m[32m 149[2mms[22m[39m
|
|
681
|
-
[32m✓[39m [30m[43m node [49m[39m test/components/quotes/MyAccountQuotesStatusSelector.test.tsx [2m([22m[2m14 tests[22m[2m)[22m[32m
|
|
682
|
-
[32m✓[39m [30m[43m node [49m[39m test/utils/localization/hreflang.test.ts [2m([22m[2m8 tests[22m[2m)[22m[32m
|
|
683
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
684
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
685
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
680
|
+
[32m✓[39m [30m[43m node [49m[39m test/components/quotes/MyAccountQuotesStatusSelector.test.tsx [2m([22m[2m14 tests[22m[2m)[22m[32m 124[2mms[22m[39m
|
|
681
|
+
[32m✓[39m [30m[43m node [49m[39m test/utils/localization/hreflang.test.ts [2m([22m[2m8 tests[22m[2m)[22m[32m 6[2mms[22m[39m
|
|
682
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/account/getMyAccountRoutes.test.ts [2m([22m[2m13 tests[22m[2m)[22m[32m 6[2mms[22m[39m
|
|
683
|
+
[32m✓[39m [30m[43m node [49m[39m test/server/cms/index.test.ts [2m([22m[2m7 tests[22m[2m)[22m[32m 9[2mms[22m[39m
|
|
684
|
+
[32m✓[39m [30m[43m node [49m[39m test/components/quotes/MyAccountQuotesSelectedTags.test.tsx [2m([22m[2m10 tests[22m[2m)[22m[32m 72[2mms[22m[39m
|
|
686
685
|
[32m✓[39m [30m[43m node [49m[39m test/server/content/promiseCache.test.ts [2m([22m[2m10 tests[22m[2m)[22m[32m 14[2mms[22m[39m
|
|
687
|
-
[32m✓[39m [30m[43m node [49m[39m test/sdk/redirects/index.test.ts [2m([22m[2m7 tests[22m[2m)[22m[32m
|
|
688
|
-
[32m✓[39m [30m[43m node [49m[39m test/sdk/orderEntry/useOrderEntryUpload.test.ts [2m([22m[2m8 tests[22m[2m)[22m[32m
|
|
689
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
690
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
691
|
-
[32m✓[39m [30m[43m node [49m[39m test/utils/trustedForwardedHost.test.ts [2m([22m[2m36 tests[22m[2m)[22m[32m
|
|
692
|
-
[32m✓[39m [30m[43m node [49m[39m test/proxy.localization.test.ts [2m([22m[2m5 tests[22m[2m)[22m[32m
|
|
693
|
-
[32m✓[39m [30m[43m node [49m[39m test/components/account/orders/getDeliveryOptionLabel.test.ts [2m([22m[2m21 tests[22m[2m)[22m[32m
|
|
694
|
-
[32m✓[39m [30m[43m node [49m[39m test/sdk/graphql/retryPolicy.test.ts [2m([22m[2m18 tests[22m[2m)[22m[32m
|
|
695
|
-
[32m✓[39m [30m[43m node [49m[39m test/server/
|
|
696
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
697
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
698
|
-
|
|
699
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
700
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
701
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
702
|
-
[32m✓[39m [30m[43m node [49m[39m test/sdk/
|
|
703
|
-
[32m✓[39m [30m[43m node [49m[39m test/sdk/
|
|
704
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
705
|
-
[32m✓[39m [30m[43m node [49m[39m test/components/account/orders/StatusCard.test.ts [2m([22m[2m3 tests[22m[2m)[22m[32m
|
|
706
|
-
[32m✓[39m [30m[43m node [49m[39m test/sdk/localization/store-url.test.ts [2m([22m[2m4 tests[22m[2m)[22m[32m
|
|
707
|
-
[32m✓[39m [30m[43m node [49m[39m test/sdk/
|
|
708
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
709
|
-
[32m✓[39m [30m[43m node [49m[39m test/server/cms/global.test.ts [2m([22m[2m3 tests[22m[2m)[22m[32m 5[2mms[22m[39m
|
|
686
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/redirects/index.test.ts [2m([22m[2m7 tests[22m[2m)[22m[32m 33[2mms[22m[39m
|
|
687
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/orderEntry/useOrderEntryUpload.test.ts [2m([22m[2m8 tests[22m[2m)[22m[32m 63[2mms[22m[39m
|
|
688
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/orderEntry/useOrderEntry.test.ts [2m([22m[2m8 tests[22m[2m)[22m[32m 33[2mms[22m[39m
|
|
689
|
+
[32m✓[39m [30m[43m node [49m[39m test/utils/toRevalidate.test.ts [2m([22m[2m16 tests[22m[2m)[22m[32m 35[2mms[22m[39m
|
|
690
|
+
[32m✓[39m [30m[43m node [49m[39m test/utils/trustedForwardedHost.test.ts [2m([22m[2m36 tests[22m[2m)[22m[32m 8[2mms[22m[39m
|
|
691
|
+
[32m✓[39m [30m[43m node [49m[39m test/proxy.localization.test.ts [2m([22m[2m5 tests[22m[2m)[22m[32m 33[2mms[22m[39m
|
|
692
|
+
[32m✓[39m [30m[43m node [49m[39m test/components/account/orders/getDeliveryOptionLabel.test.ts [2m([22m[2m21 tests[22m[2m)[22m[32m 6[2mms[22m[39m
|
|
693
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/graphql/retryPolicy.test.ts [2m([22m[2m18 tests[22m[2m)[22m[32m 13[2mms[22m[39m
|
|
694
|
+
[32m✓[39m [30m[43m node [49m[39m test/server/index.test.ts [2m([22m[2m7 tests[22m[2m)[22m[33m 560[2mms[22m[39m
|
|
695
|
+
[32m✓[39m [30m[43m node [49m[39m test/server/cms/myAccountDefaultSections.test.ts [2m([22m[2m9 tests[22m[2m)[22m[32m 6[2mms[22m[39m
|
|
696
|
+
[32m✓[39m [30m[43m node [49m[39m test/utils/productJsonLdRendering.test.tsx [2m([22m[2m5 tests[22m[2m)[22m[32m 11[2mms[22m[39m
|
|
697
|
+
[32m✓[39m [30m[43m node [49m[39m test/proxy.test.ts [2m([22m[2m4 tests[22m[2m)[22m[32m 17[2mms[22m[39m
|
|
698
|
+
[32m✓[39m [30m[43m node [49m[39m test/pages/api/logout.test.ts [2m([22m[2m4 tests[22m[2m)[22m[32m 25[2mms[22m[39m
|
|
699
|
+
[32m✓[39m [30m[43m node [49m[39m test/utils/shouldBypassRefreshToken.test.ts [2m([22m[2m14 tests[22m[2m)[22m[32m 4[2mms[22m[39m
|
|
700
|
+
[32m✓[39m [30m[43m node [49m[39m test/server/webops-api.test.ts [2m([22m[2m9 tests[22m[2m)[22m[32m 17[2mms[22m[39m
|
|
701
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/orderEntry/useOrderFormItems.test.ts [2m([22m[2m7 tests[22m[2m)[22m[32m 44[2mms[22m[39m
|
|
702
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/analytics/useStartRecommendationSession.test.ts [2m([22m[2m6 tests[22m[2m)[22m[32m 46[2mms[22m[39m
|
|
703
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/deliveryPromise/queries.test.ts [2m([22m[2m4 tests[22m[2m)[22m[32m 7[2mms[22m[39m
|
|
704
|
+
[32m✓[39m [30m[43m node [49m[39m test/components/account/orders/StatusCard.test.ts [2m([22m[2m3 tests[22m[2m)[22m[32m 22[2mms[22m[39m
|
|
705
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/localization/store-url.test.ts [2m([22m[2m4 tests[22m[2m)[22m[32m 4[2mms[22m[39m
|
|
706
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/cart/waitForSessionValidated.test.ts [2m([22m[2m5 tests[22m[2m)[22m[32m 9[2mms[22m[39m
|
|
707
|
+
[32m✓[39m [30m[43m node [49m[39m test/server/cms/global.test.ts [2m([22m[2m3 tests[22m[2m)[22m[32m 4[2mms[22m[39m
|
|
710
708
|
[32m✓[39m [30m[43m node [49m[39m test/sdk/deliveryPromise/provider.test.ts [2m([22m[2m11 tests[22m[2m)[22m[32m 6[2mms[22m[39m
|
|
711
|
-
[32m✓[39m [30m[43m node [49m[39m test/sdk/auth/useAuth.test.ts [2m([22m[2m5 tests[22m[2m)[22m[32m
|
|
709
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/auth/useAuth.test.ts [2m([22m[2m5 tests[22m[2m)[22m[32m 25[2mms[22m[39m
|
|
712
710
|
[90mstderr[2m | test/server/storeDirectives.test.ts[2m > [22m[2mstore directives through the core server[2m > [22m[2mapplies @auth from a store field and validates the session once
|
|
713
711
|
[22m[39mhttps://storeframework.vtexcommercestable.com.br/api/vtexid/credential/validate {
|
|
714
712
|
headers: { [32m'content-type'[39m: [32m'application/json'[39m, [32m'X-FORWARDED-HOST'[39m: [32m''[39m },
|
|
@@ -716,44 +714,44 @@ Warning: React does not recognize the `providerProps` prop on a DOM element. If
|
|
|
716
714
|
method: [32m'POST'[39m
|
|
717
715
|
} { status: [33m401[39m, statusText: [32m'Unauthorized'[39m, headers: {} }
|
|
718
716
|
|
|
719
|
-
[32m✓[39m [30m[43m node [49m[39m test/server/storeDirectives.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m
|
|
720
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
721
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
722
|
-
[32m✓[39m [30m[43m node [49m[39m test/utils/getRequestHostname.test.ts [2m([22m[2m12 tests[22m[2m)[22m[32m
|
|
723
|
-
[32m✓[39m [30m[43m node [49m[39m test/pages/api/preview.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m
|
|
724
|
-
[32m✓[39m [30m[43m node [49m[39m test/components/account/Layout.test.tsx [2m([22m[2m6 tests[22m[2m)[22m[32m
|
|
725
|
-
[32m✓[39m [30m[43m node [49m[39m test/components/search/SearchInput.test.ts [2m([22m[2m6 tests[22m[2m)[22m[32m
|
|
726
|
-
[32m✓[39m [30m[43m node [49m[39m test/utils/validateSessionRefreshToken.test.ts [2m([22m[2m6 tests[22m[2m)[22m[32m
|
|
727
|
-
[32m✓[39m [30m[43m node [49m[39m test/components/search/SearchDropdown.test.tsx [2m([22m[2m1 test[22m[2m)[22m[32m
|
|
728
|
-
[32m✓[39m [30m[43m node [49m[39m test/components/region/useRegion.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m
|
|
729
|
-
[32m✓[39m [30m[43m node [49m[39m test/pages/pvt/account/403.test.ts [2m([22m[2m5 tests[22m[2m)[22m[32m
|
|
730
|
-
[32m✓[39m [30m[43m node [49m[39m test/sdk/recommendations/vrn.test.ts [2m([22m[2m5 tests[22m[2m)[22m[32m
|
|
731
|
-
[32m✓[39m [30m[43m node [49m[39m test/utils/retry.test.ts [2m([22m[2m5 tests[22m[2m)[22m[32m
|
|
732
|
-
[32m✓[39m [30m[43m node [49m[39m test/sdk/account/getIsB2BBuyer.test.ts [2m([22m[2m7 tests[22m[2m)[22m[32m
|
|
733
|
-
[32m✓[39m [30m[43m node [49m[39m test/sdk/account/getB2BSessionClaims.test.ts [2m([22m[2m4 tests[22m[2m)[22m[32m
|
|
734
|
-
[32m✓[39m [30m[43m node [49m[39m test/sdk/recommendations/useRecommendationUserId.test.ts [2m([22m[2m4 tests[22m[2m)[22m[32m
|
|
717
|
+
[32m✓[39m [30m[43m node [49m[39m test/server/storeDirectives.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m 58[2mms[22m[39m
|
|
718
|
+
[32m✓[39m [30m[43m node [49m[39m test/server/rootSpan.test.ts [2m([22m[2m4 tests[22m[2m)[22m[32m 33[2mms[22m[39m
|
|
719
|
+
[32m✓[39m [30m[43m node [49m[39m test/utils/mergeDiscoveryConfig.test.ts [2m([22m[2m8 tests[22m[2m)[22m[32m 7[2mms[22m[39m
|
|
720
|
+
[32m✓[39m [30m[43m node [49m[39m test/utils/getRequestHostname.test.ts [2m([22m[2m12 tests[22m[2m)[22m[32m 5[2mms[22m[39m
|
|
721
|
+
[32m✓[39m [30m[43m node [49m[39m test/pages/api/preview.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m 7[2mms[22m[39m
|
|
722
|
+
[32m✓[39m [30m[43m node [49m[39m test/components/account/Layout.test.tsx [2m([22m[2m6 tests[22m[2m)[22m[32m 50[2mms[22m[39m
|
|
723
|
+
[32m✓[39m [30m[43m node [49m[39m test/components/search/SearchInput.test.ts [2m([22m[2m6 tests[22m[2m)[22m[32m 6[2mms[22m[39m
|
|
724
|
+
[32m✓[39m [30m[43m node [49m[39m test/utils/validateSessionRefreshToken.test.ts [2m([22m[2m6 tests[22m[2m)[22m[32m 3[2mms[22m[39m
|
|
725
|
+
[32m✓[39m [30m[43m node [49m[39m test/components/search/SearchDropdown.test.tsx [2m([22m[2m1 test[22m[2m)[22m[32m 17[2mms[22m[39m
|
|
726
|
+
[32m✓[39m [30m[43m node [49m[39m test/components/region/useRegion.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m 22[2mms[22m[39m
|
|
727
|
+
[32m✓[39m [30m[43m node [49m[39m test/pages/pvt/account/403.test.ts [2m([22m[2m5 tests[22m[2m)[22m[32m 4[2mms[22m[39m
|
|
728
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/recommendations/vrn.test.ts [2m([22m[2m5 tests[22m[2m)[22m[32m 3[2mms[22m[39m
|
|
729
|
+
[32m✓[39m [30m[43m node [49m[39m test/utils/retry.test.ts [2m([22m[2m5 tests[22m[2m)[22m[32m 17[2mms[22m[39m
|
|
730
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/account/getIsB2BBuyer.test.ts [2m([22m[2m7 tests[22m[2m)[22m[32m 5[2mms[22m[39m
|
|
731
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/account/getB2BSessionClaims.test.ts [2m([22m[2m4 tests[22m[2m)[22m[32m 3[2mms[22m[39m
|
|
732
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/recommendations/useRecommendationUserId.test.ts [2m([22m[2m4 tests[22m[2m)[22m[32m 184[2mms[22m[39m
|
|
735
733
|
[32m✓[39m [30m[43m node [49m[39m test/utils/subDomainPrefixWarning.test.ts [2m([22m[2m6 tests[22m[2m)[22m[32m 4[2mms[22m[39m
|
|
736
|
-
[32m✓[39m [30m[43m node [49m[39m test/utils/userOrderStatus.test.ts [2m([22m[2m4 tests[22m[2m)[22m[32m
|
|
737
|
-
[32m✓[39m [30m[43m node [49m[39m test/utils/unlockResponse.test.ts [2m([22m[2m11 tests[22m[2m)[22m[32m
|
|
738
|
-
[32m✓[39m [30m[43m node [49m[39m test/sdk/recommendations/useRecommendations.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m
|
|
739
|
-
[32m✓[39m [30m[43m node [49m[39m test/components/account/OrganizationDrawerBody.test.tsx [2m([22m[2m3 tests[22m[2m)[22m[32m
|
|
740
|
-
[32m✓[39m [30m[43m node [49m[39m test/sdk/deliveryPromise/reducer.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m
|
|
741
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
742
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
734
|
+
[32m✓[39m [30m[43m node [49m[39m test/utils/userOrderStatus.test.ts [2m([22m[2m4 tests[22m[2m)[22m[32m 4[2mms[22m[39m
|
|
735
|
+
[32m✓[39m [30m[43m node [49m[39m test/utils/unlockResponse.test.ts [2m([22m[2m11 tests[22m[2m)[22m[32m 5[2mms[22m[39m
|
|
736
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/recommendations/useRecommendations.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m 4[2mms[22m[39m
|
|
737
|
+
[32m✓[39m [30m[43m node [49m[39m test/components/account/OrganizationDrawerBody.test.tsx [2m([22m[2m3 tests[22m[2m)[22m[32m 30[2mms[22m[39m
|
|
738
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/deliveryPromise/reducer.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m 4[2mms[22m[39m
|
|
739
|
+
[32m✓[39m [30m[43m node [49m[39m test/components/quotes/MyAccountQuoteStatusBadge.test.tsx [2m([22m[2m4 tests[22m[2m)[22m[32m 36[2mms[22m[39m
|
|
740
|
+
[32m✓[39m [30m[43m node [49m[39m test/utils/isLocalHost.test.ts [2m([22m[2m7 tests[22m[2m)[22m[32m 4[2mms[22m[39m
|
|
743
741
|
[32m✓[39m [30m[43m node [49m[39m test/sdk/session/toSessionInput.test.ts [2m([22m[2m3 tests[22m[2m)[22m[32m 4[2mms[22m[39m
|
|
744
|
-
[32m✓[39m [30m[43m node [49m[39m test/components/account/orders/getOrderTotalLabel.test.ts [2m([22m[2m6 tests[22m[2m)[22m[32m
|
|
745
|
-
[32m✓[39m [30m[43m node [49m[39m test/components/account/orders/listOrdersLabels.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m
|
|
746
|
-
[32m✓[39m [30m[43m node [49m[39m test/utils/getCookie.test.ts [2m([22m[2m4 tests[22m[2m)[22m[32m
|
|
747
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
748
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
749
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
742
|
+
[32m✓[39m [30m[43m node [49m[39m test/components/account/orders/getOrderTotalLabel.test.ts [2m([22m[2m6 tests[22m[2m)[22m[32m 3[2mms[22m[39m
|
|
743
|
+
[32m✓[39m [30m[43m node [49m[39m test/components/account/orders/listOrdersLabels.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m 3[2mms[22m[39m
|
|
744
|
+
[32m✓[39m [30m[43m node [49m[39m test/utils/getCookie.test.ts [2m([22m[2m4 tests[22m[2m)[22m[32m 4[2mms[22m[39m
|
|
745
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/session/isSignInAreaResolved.test.ts [2m([22m[2m3 tests[22m[2m)[22m[32m 3[2mms[22m[39m
|
|
746
|
+
[32m✓[39m [30m[43m node [49m[39m test/utils/filterChannel.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m 2[2mms[22m[39m
|
|
747
|
+
[32m✓[39m [30m[43m node [49m[39m test/components/auth/ProfileChallenge.test.tsx [2m([22m[2m3 tests[22m[2m)[22m[32m 34[2mms[22m[39m
|
|
750
748
|
[32m✓[39m [30m[43m node [49m[39m test/sdk/analytics/utils.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m 3[2mms[22m[39m
|
|
751
749
|
[32m✓[39m [30m[43m node [49m[39m test/instrumentation.test.ts [2m([22m[2m3 tests[22m[2m)[22m[32m 5[2mms[22m[39m
|
|
752
|
-
[32m✓[39m [30m[43m node [49m[39m test/components/account/orders/orderDetailsLabels.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m
|
|
753
|
-
[32m✓[39m [30m[43m node [49m[39m test/sdk/account/clearPersistedSessionState.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m
|
|
750
|
+
[32m✓[39m [30m[43m node [49m[39m test/components/account/orders/orderDetailsLabels.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m 2[2mms[22m[39m
|
|
751
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/account/clearPersistedSessionState.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m 6[2mms[22m[39m
|
|
754
752
|
|
|
755
|
-
[2m Test Files [22m [1m[
|
|
756
|
-
[2m Tests [22m [1m[
|
|
757
|
-
[2m Start at [22m
|
|
758
|
-
[2m Duration [22m
|
|
753
|
+
[2m Test Files [22m [1m[32m152 passed[39m[22m[90m (152)[39m
|
|
754
|
+
[2m Tests [22m [1m[32m1313 passed[39m[22m[90m (1313)[39m
|
|
755
|
+
[2m Start at [22m 13:21:27
|
|
756
|
+
[2m Duration [22m 53.04s[2m (transform 11.66s, setup 0ms, import 45.59s, tests 18.41s, environment 66.42s)[22m
|
|
759
757
|
|
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,12 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [4.11.4-dev.5](https://github.com/vtex/faststore/compare/v4.11.4-dev.4...v4.11.4-dev.5) (2026-11-19)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- **core:** retry CMS fetch bypassing cache on invalid JSON ([#3590](https://github.com/vtex/faststore/issues/3590)) ([12f9062](https://github.com/vtex/faststore/commit/12f9062184eef948f29d2aeac0308c97300d842f))
|
|
11
|
+
|
|
6
12
|
## [4.11.4-dev.4](https://github.com/vtex/faststore/compare/v4.11.4-dev.3...v4.11.4-dev.4) (2026-11-19)
|
|
7
13
|
|
|
8
14
|
### Bug Fixes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@faststore/core",
|
|
3
|
-
"version": "4.11.4-dev.
|
|
3
|
+
"version": "4.11.4-dev.5",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -70,11 +70,11 @@
|
|
|
70
70
|
"style-loader": "^3.3.1",
|
|
71
71
|
"swr": "^2.2.5",
|
|
72
72
|
"use-sync-external-store": "^1.6.0",
|
|
73
|
-
"@faststore/api": "4.11.4-dev.
|
|
74
|
-
"@faststore/diagnostics": "4.11.4-dev.
|
|
75
|
-
"@faststore/
|
|
76
|
-
"@faststore/
|
|
77
|
-
"@faststore/ui": "4.11.4-dev.
|
|
73
|
+
"@faststore/api": "4.11.4-dev.5",
|
|
74
|
+
"@faststore/diagnostics": "4.11.4-dev.5",
|
|
75
|
+
"@faststore/sdk": "4.11.4-dev.5",
|
|
76
|
+
"@faststore/lighthouse": "4.11.4-dev.5",
|
|
77
|
+
"@faststore/ui": "4.11.4-dev.5"
|
|
78
78
|
},
|
|
79
79
|
"devDependencies": {
|
|
80
80
|
"@cypress/code-coverage": "^3.12.1",
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import ClientCMS from '@vtex/client-cms'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Query param added to the retry request. The CDN in front of the CMS API
|
|
5
|
+
* includes the query string in its cache key, so a new value is a cache miss
|
|
6
|
+
* that reaches the origin. A `Cache-Control: no-cache` request header is not
|
|
7
|
+
* enough, since CDNs commonly ignore it.
|
|
8
|
+
*/
|
|
9
|
+
export const CACHE_BUST_PARAM = 'cb'
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* The cache-busting value changes once per window instead of per request, so
|
|
13
|
+
* retries for the same URL within a window share one CDN cache entry: at most
|
|
14
|
+
* one of them reaches the origin, instead of every page generation causing a
|
|
15
|
+
* new cache miss while the bad response stays cached under the original URL.
|
|
16
|
+
*/
|
|
17
|
+
export const CACHE_BUST_WINDOW_MS = 60 * 1000
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* How long a URL whose cache-busting retry also failed skips further retries.
|
|
21
|
+
*
|
|
22
|
+
* Must be at least `CACHE_BUST_WINDOW_MS`: the next retry after the cooldown
|
|
23
|
+
* has to fall in a later window, so it uses a new cache-busting value instead
|
|
24
|
+
* of the one whose cached response just failed. Derived from it to keep that
|
|
25
|
+
* invariant when either value changes.
|
|
26
|
+
*/
|
|
27
|
+
export const RETRY_COOLDOWN_MS = CACHE_BUST_WINDOW_MS
|
|
28
|
+
|
|
29
|
+
type ErrorShape = {
|
|
30
|
+
name?: unknown
|
|
31
|
+
type?: unknown
|
|
32
|
+
cause?: { code?: unknown }
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Error codes Node raises while decompressing a response body: zlib (gzip,
|
|
37
|
+
* deflate) uses `Z_*` (e.g. `Z_DATA_ERROR`, `Z_BUF_ERROR`), and brotli uses
|
|
38
|
+
* `ERR_` + the decoder error name, which itself starts with an underscore (e.g.
|
|
39
|
+
* `ERR__ERROR_FORMAT_PADDING_1`). The double underscore is not a typo.
|
|
40
|
+
*/
|
|
41
|
+
const BODY_DECODING_ERROR_CODE = /^(Z_|ERR__ERROR_)/
|
|
42
|
+
|
|
43
|
+
const decodingErrorCode = (error: unknown) => {
|
|
44
|
+
const code = (error as ErrorShape | null)?.cause?.code
|
|
45
|
+
|
|
46
|
+
return typeof code === 'string' && BODY_DECODING_ERROR_CODE.test(code)
|
|
47
|
+
? code
|
|
48
|
+
: undefined
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Whether `error` means the response arrived but its body could not be parsed
|
|
53
|
+
* or decoded:
|
|
54
|
+
* - `SyntaxError`: `response.json()` on a body that is not valid JSON. Checked
|
|
55
|
+
* by name so it also matches errors created in another realm (e.g. a test vm
|
|
56
|
+
* context).
|
|
57
|
+
* - A decoding error while reading the body, when `Content-Encoding` does not
|
|
58
|
+
* match the bytes: undici rejects with `TypeError: terminated`, caused by a
|
|
59
|
+
* zlib or brotli error.
|
|
60
|
+
* - `invalid-json`: the parse failure as reported by `node-fetch`.
|
|
61
|
+
* `@vtex/client-cms` only falls back to it when there is no global fetch,
|
|
62
|
+
* which does not happen on the Node versions core supports (>= 20.9), so this
|
|
63
|
+
* case is only a safeguard.
|
|
64
|
+
*
|
|
65
|
+
* Bodies that parse to an unexpected value (e.g. `null`) are not retried: they
|
|
66
|
+
* keep reaching callers as before.
|
|
67
|
+
*/
|
|
68
|
+
const isInvalidBodyError = (error: unknown) => {
|
|
69
|
+
const { name, type } = (error ?? {}) as ErrorShape
|
|
70
|
+
|
|
71
|
+
return (
|
|
72
|
+
name === 'SyntaxError' ||
|
|
73
|
+
type === 'invalid-json' ||
|
|
74
|
+
decodingErrorCode(error) !== undefined
|
|
75
|
+
)
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/** Error name plus decoding code, without the message (it may embed body). */
|
|
79
|
+
const describeError = (error: unknown) =>
|
|
80
|
+
[(error as ErrorShape | null)?.name, decodingErrorCode(error)]
|
|
81
|
+
.filter(Boolean)
|
|
82
|
+
.join(': ')
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* `ClientCMS` that retries a request once, bypassing CDN caches, when the
|
|
86
|
+
* response body cannot be parsed or decoded. A single bad cached response
|
|
87
|
+
* (e.g. a compressed body stored without its `Content-Encoding`) would
|
|
88
|
+
* otherwise fail every page that depends on it until the cache entry expires.
|
|
89
|
+
*
|
|
90
|
+
* Only that case is retried: network errors are already retried by
|
|
91
|
+
* `@vtex/client-cms`, and non-2xx responses keep failing as before.
|
|
92
|
+
*
|
|
93
|
+
* The retry reaches the origin. When the retry fails too, for any reason (an
|
|
94
|
+
* invalid body, a 5xx, a network error), the origin itself is likely unhealthy,
|
|
95
|
+
* so that URL fails fast without retrying for `RETRY_COOLDOWN_MS` instead of
|
|
96
|
+
* adding an uncached origin hit to every page generation. Skipping the retry
|
|
97
|
+
* only falls back to the behavior without this class.
|
|
98
|
+
*/
|
|
99
|
+
export class ResilientClientCMS extends ClientCMS {
|
|
100
|
+
/** URL -> time until which its cache-busting retry is skipped. */
|
|
101
|
+
private readonly retryCooldownUntil = new Map<string, number>()
|
|
102
|
+
|
|
103
|
+
async fetch<T>(path = '', params?: URLSearchParams): Promise<T> {
|
|
104
|
+
try {
|
|
105
|
+
return await super.fetch<T>(path, params)
|
|
106
|
+
} catch (error) {
|
|
107
|
+
if (!isInvalidBodyError(error)) {
|
|
108
|
+
throw error
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
const url = [path, params?.toString()].filter(Boolean).join('?')
|
|
112
|
+
if (this.isCoolingDown(url)) {
|
|
113
|
+
throw error
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
// Only the error name (and decoding error code) is logged: a JSON parse
|
|
117
|
+
// error message embeds the start of the body, which may be binary.
|
|
118
|
+
console.warn(
|
|
119
|
+
`[CMS] Invalid response body for "${url}" (${describeError(error)}). Retrying once bypassing the cache.`
|
|
120
|
+
)
|
|
121
|
+
|
|
122
|
+
const cacheBustingParams = new URLSearchParams(params)
|
|
123
|
+
cacheBustingParams.set(
|
|
124
|
+
CACHE_BUST_PARAM,
|
|
125
|
+
Math.floor(Date.now() / CACHE_BUST_WINDOW_MS).toString()
|
|
126
|
+
)
|
|
127
|
+
|
|
128
|
+
try {
|
|
129
|
+
return await super.fetch<T>(path, cacheBustingParams)
|
|
130
|
+
} catch (retryError) {
|
|
131
|
+
// Any retry failure backs off, not only another invalid body: a 5xx or
|
|
132
|
+
// network error from the origin is also a reason not to add load.
|
|
133
|
+
this.startCooldown(url)
|
|
134
|
+
console.warn(
|
|
135
|
+
`[CMS] Cache-busting retry failed for "${url}" (${describeError(retryError)}). Skipping retries for this URL for ${RETRY_COOLDOWN_MS / 1000}s.`
|
|
136
|
+
)
|
|
137
|
+
throw retryError
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
private isCoolingDown(url: string) {
|
|
143
|
+
const until = this.retryCooldownUntil.get(url)
|
|
144
|
+
|
|
145
|
+
if (until === undefined) {
|
|
146
|
+
return false
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
if (until > Date.now()) {
|
|
150
|
+
return true
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
this.retryCooldownUntil.delete(url)
|
|
154
|
+
return false
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
private startCooldown(url: string) {
|
|
158
|
+
const now = Date.now()
|
|
159
|
+
|
|
160
|
+
// Drop expired entries so URLs that are never requested again do not pile
|
|
161
|
+
// up for the lifetime of the process.
|
|
162
|
+
this.retryCooldownUntil.forEach((until, key) => {
|
|
163
|
+
if (until <= now) this.retryCooldownUntil.delete(key)
|
|
164
|
+
})
|
|
165
|
+
|
|
166
|
+
this.retryCooldownUntil.set(url, now + RETRY_COOLDOWN_MS)
|
|
167
|
+
}
|
|
168
|
+
}
|
package/src/server/cms/index.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import type { ContentData, Locator } from '@vtex/client-cms'
|
|
2
|
-
import ClientCMS from '@vtex/client-cms'
|
|
2
|
+
import type ClientCMS from '@vtex/client-cms'
|
|
3
3
|
|
|
4
4
|
import MultipleContentError from 'src/sdk/error/MultipleContentError'
|
|
5
5
|
import { getStoreURL } from 'src/sdk/localization/useLocalizationConfig'
|
|
6
6
|
import { createPromiseCache } from 'src/server/content/promiseCache'
|
|
7
7
|
import { sanitizeHost } from 'src/utils/utilities'
|
|
8
8
|
import config from '../../../discovery.config'
|
|
9
|
+
import { ResilientClientCMS } from './ResilientClientCMS'
|
|
9
10
|
|
|
10
11
|
export type Options =
|
|
11
12
|
| Locator
|
|
@@ -72,7 +73,7 @@ export const isLocator = (x: any): x is Locator =>
|
|
|
72
73
|
typeof x.documentId === 'string' ||
|
|
73
74
|
typeof x.versionId === 'string')
|
|
74
75
|
|
|
75
|
-
export const clientCMS = new
|
|
76
|
+
export const clientCMS = new ResilientClientCMS({
|
|
76
77
|
workspace: config.api.workspace,
|
|
77
78
|
tenant: config.api.storeId,
|
|
78
79
|
builder:
|
|
@@ -0,0 +1,482 @@
|
|
|
1
|
+
import type { Server } from 'node:http'
|
|
2
|
+
import { createServer } from 'node:http'
|
|
3
|
+
import type { AddressInfo } from 'node:net'
|
|
4
|
+
import { gzipSync } from 'node:zlib'
|
|
5
|
+
import ClientCMS from '@vtex/client-cms'
|
|
6
|
+
import type { ContentData, ContentPage } from '@vtex/client-cms'
|
|
7
|
+
import {
|
|
8
|
+
afterAll,
|
|
9
|
+
afterEach,
|
|
10
|
+
beforeAll,
|
|
11
|
+
beforeEach,
|
|
12
|
+
describe,
|
|
13
|
+
expect,
|
|
14
|
+
it,
|
|
15
|
+
vi,
|
|
16
|
+
} from 'vitest'
|
|
17
|
+
|
|
18
|
+
import { clientCMS, cmsPageCache, getCMSPage } from '../../../src/server/cms'
|
|
19
|
+
import {
|
|
20
|
+
CACHE_BUST_PARAM,
|
|
21
|
+
CACHE_BUST_WINDOW_MS,
|
|
22
|
+
RETRY_COOLDOWN_MS,
|
|
23
|
+
ResilientClientCMS,
|
|
24
|
+
} from '../../../src/server/cms/ResilientClientCMS'
|
|
25
|
+
|
|
26
|
+
const invalidJSON = () =>
|
|
27
|
+
new SyntaxError('Unexpected token \u001f in JSON at position 0')
|
|
28
|
+
|
|
29
|
+
const contentData = (id: string): ContentData => ({
|
|
30
|
+
id,
|
|
31
|
+
name: id,
|
|
32
|
+
status: 'published',
|
|
33
|
+
type: 'plp',
|
|
34
|
+
sections: [],
|
|
35
|
+
releaseId: '',
|
|
36
|
+
})
|
|
37
|
+
|
|
38
|
+
const listingPage = (
|
|
39
|
+
page: number,
|
|
40
|
+
count: number,
|
|
41
|
+
totalItems: number
|
|
42
|
+
): ContentPage => ({
|
|
43
|
+
data: Array.from({ length: count }, (_, i) =>
|
|
44
|
+
contentData(`page-${page}-item-${i}`)
|
|
45
|
+
),
|
|
46
|
+
hasNextPage: page * 10 < totalItems,
|
|
47
|
+
totalItems,
|
|
48
|
+
})
|
|
49
|
+
|
|
50
|
+
describe('ResilientClientCMS', () => {
|
|
51
|
+
// `ResilientClientCMS#fetch` delegates to the `ClientCMS` implementation,
|
|
52
|
+
// which performs the HTTP request and parses the JSON body.
|
|
53
|
+
let baseFetch: ReturnType<typeof vi.spyOn>
|
|
54
|
+
let warn: ReturnType<typeof vi.spyOn>
|
|
55
|
+
|
|
56
|
+
const createClient = () =>
|
|
57
|
+
new ResilientClientCMS({
|
|
58
|
+
tenant: 'store',
|
|
59
|
+
workspace: 'master',
|
|
60
|
+
builder: 'faststore',
|
|
61
|
+
host: 'www.example.com',
|
|
62
|
+
})
|
|
63
|
+
|
|
64
|
+
const paramsOfCall = (call: number) =>
|
|
65
|
+
baseFetch.mock.calls[call][1] as URLSearchParams | undefined
|
|
66
|
+
|
|
67
|
+
beforeEach(() => {
|
|
68
|
+
cmsPageCache.clear()
|
|
69
|
+
baseFetch = vi.spyOn(ClientCMS.prototype, 'fetch')
|
|
70
|
+
warn = vi.spyOn(console, 'warn').mockImplementation(() => {})
|
|
71
|
+
})
|
|
72
|
+
|
|
73
|
+
afterEach(() => {
|
|
74
|
+
vi.restoreAllMocks()
|
|
75
|
+
})
|
|
76
|
+
|
|
77
|
+
it('makes a single request when the response is valid', async () => {
|
|
78
|
+
const page = listingPage(1, 3, 3)
|
|
79
|
+
baseFetch.mockResolvedValueOnce(page)
|
|
80
|
+
|
|
81
|
+
const result = await createClient().getCMSPagesByContentType('plp')
|
|
82
|
+
|
|
83
|
+
expect(result).toEqual(page)
|
|
84
|
+
expect(baseFetch).toHaveBeenCalledTimes(1)
|
|
85
|
+
expect(paramsOfCall(0)?.has(CACHE_BUST_PARAM)).toBe(false)
|
|
86
|
+
expect(warn).not.toHaveBeenCalled()
|
|
87
|
+
})
|
|
88
|
+
|
|
89
|
+
it('retries once bypassing the cache when the body is not valid JSON', async () => {
|
|
90
|
+
const page = listingPage(8, 10, 100)
|
|
91
|
+
baseFetch.mockRejectedValueOnce(invalidJSON()).mockResolvedValueOnce(page)
|
|
92
|
+
|
|
93
|
+
const result = await createClient().getCMSPagesByContentType('plp', {
|
|
94
|
+
page: 8,
|
|
95
|
+
perPage: 10,
|
|
96
|
+
})
|
|
97
|
+
|
|
98
|
+
expect(result).toEqual(page)
|
|
99
|
+
expect(baseFetch).toHaveBeenCalledTimes(2)
|
|
100
|
+
|
|
101
|
+
expect(baseFetch.mock.calls[1][0]).toBe('plp')
|
|
102
|
+
const retryParams = paramsOfCall(1)
|
|
103
|
+
expect(retryParams?.get('page')).toBe('8')
|
|
104
|
+
expect(retryParams?.get('per_page')).toBe('10')
|
|
105
|
+
expect(retryParams?.get(CACHE_BUST_PARAM)).toMatch(/^\d+$/)
|
|
106
|
+
// The original params are not mutated.
|
|
107
|
+
expect(paramsOfCall(0)?.has(CACHE_BUST_PARAM)).toBe(false)
|
|
108
|
+
|
|
109
|
+
expect(warn).toHaveBeenCalledTimes(1)
|
|
110
|
+
expect(warn.mock.calls[0][0]).toContain('plp?page=8&per_page=10')
|
|
111
|
+
})
|
|
112
|
+
|
|
113
|
+
it('rejects when the retry is not valid JSON either', async () => {
|
|
114
|
+
baseFetch
|
|
115
|
+
.mockRejectedValueOnce(invalidJSON())
|
|
116
|
+
.mockRejectedValueOnce(invalidJSON())
|
|
117
|
+
|
|
118
|
+
await expect(
|
|
119
|
+
createClient().getCMSPagesByContentType('plp')
|
|
120
|
+
).rejects.toBeInstanceOf(SyntaxError)
|
|
121
|
+
expect(baseFetch).toHaveBeenCalledTimes(2)
|
|
122
|
+
})
|
|
123
|
+
|
|
124
|
+
it('handles the invalid-json error raised by node-fetch', async () => {
|
|
125
|
+
const nodeFetchError = Object.assign(
|
|
126
|
+
new Error('invalid json response body'),
|
|
127
|
+
{ type: 'invalid-json' }
|
|
128
|
+
)
|
|
129
|
+
const document = contentData('document')
|
|
130
|
+
baseFetch
|
|
131
|
+
.mockRejectedValueOnce(nodeFetchError)
|
|
132
|
+
.mockResolvedValueOnce(document)
|
|
133
|
+
|
|
134
|
+
const result = await createClient().getCMSPage({
|
|
135
|
+
contentType: 'landingPage',
|
|
136
|
+
documentId: 'document',
|
|
137
|
+
versionId: 'version',
|
|
138
|
+
})
|
|
139
|
+
|
|
140
|
+
expect(result).toEqual(document)
|
|
141
|
+
expect(baseFetch).toHaveBeenCalledTimes(2)
|
|
142
|
+
expect(baseFetch.mock.calls[1][0]).toBe('landingPage/document')
|
|
143
|
+
expect(paramsOfCall(1)?.get('versionId')).toBe('version')
|
|
144
|
+
})
|
|
145
|
+
|
|
146
|
+
it('passes a body that parses to null through without retrying', async () => {
|
|
147
|
+
baseFetch.mockResolvedValueOnce(null)
|
|
148
|
+
|
|
149
|
+
const result = await createClient().getCMSPagesByContentType('plp')
|
|
150
|
+
|
|
151
|
+
expect(result).toBeNull()
|
|
152
|
+
expect(baseFetch).toHaveBeenCalledTimes(1)
|
|
153
|
+
expect(warn).not.toHaveBeenCalled()
|
|
154
|
+
})
|
|
155
|
+
|
|
156
|
+
it('adds the cache-busting param to requests without params', async () => {
|
|
157
|
+
baseFetch
|
|
158
|
+
.mockRejectedValueOnce(invalidJSON())
|
|
159
|
+
.mockResolvedValueOnce({ contentTypes: [{ id: 'plp' }] })
|
|
160
|
+
|
|
161
|
+
const result = await createClient().getAllContentTypeIds()
|
|
162
|
+
|
|
163
|
+
expect(result).toEqual(['plp'])
|
|
164
|
+
expect(paramsOfCall(1)?.has(CACHE_BUST_PARAM)).toBe(true)
|
|
165
|
+
})
|
|
166
|
+
|
|
167
|
+
it('does not retry other errors', async () => {
|
|
168
|
+
const error = new Error('Error while fetching')
|
|
169
|
+
baseFetch.mockRejectedValueOnce(error)
|
|
170
|
+
|
|
171
|
+
await expect(createClient().getCMSPagesByContentType('plp')).rejects.toBe(
|
|
172
|
+
error
|
|
173
|
+
)
|
|
174
|
+
expect(baseFetch).toHaveBeenCalledTimes(1)
|
|
175
|
+
expect(warn).not.toHaveBeenCalled()
|
|
176
|
+
})
|
|
177
|
+
|
|
178
|
+
it('retries when the body cannot be decoded', async () => {
|
|
179
|
+
// undici's error when `Content-Encoding` does not match the body bytes.
|
|
180
|
+
const decodingError = Object.assign(new TypeError('terminated'), {
|
|
181
|
+
cause: Object.assign(new Error('incorrect header check'), {
|
|
182
|
+
code: 'Z_DATA_ERROR',
|
|
183
|
+
}),
|
|
184
|
+
})
|
|
185
|
+
const page = listingPage(1, 1, 1)
|
|
186
|
+
baseFetch.mockRejectedValueOnce(decodingError).mockResolvedValueOnce(page)
|
|
187
|
+
|
|
188
|
+
const result = await createClient().getCMSPagesByContentType('plp')
|
|
189
|
+
|
|
190
|
+
expect(result).toEqual(page)
|
|
191
|
+
expect(baseFetch).toHaveBeenCalledTimes(2)
|
|
192
|
+
expect(warn.mock.calls[0][0]).toContain('TypeError: Z_DATA_ERROR')
|
|
193
|
+
})
|
|
194
|
+
|
|
195
|
+
it('retries a SyntaxError created in another realm', async () => {
|
|
196
|
+
const foreignSyntaxError = Object.assign(new Error('Unexpected token'), {
|
|
197
|
+
name: 'SyntaxError',
|
|
198
|
+
})
|
|
199
|
+
const page = listingPage(1, 1, 1)
|
|
200
|
+
baseFetch
|
|
201
|
+
.mockRejectedValueOnce(foreignSyntaxError)
|
|
202
|
+
.mockResolvedValueOnce(page)
|
|
203
|
+
|
|
204
|
+
const result = await createClient().getCMSPagesByContentType('plp')
|
|
205
|
+
|
|
206
|
+
expect(result).toEqual(page)
|
|
207
|
+
expect(baseFetch).toHaveBeenCalledTimes(2)
|
|
208
|
+
})
|
|
209
|
+
|
|
210
|
+
it('does not retry a connection reset while reading the body', async () => {
|
|
211
|
+
const error = Object.assign(new TypeError('terminated'), {
|
|
212
|
+
cause: Object.assign(new Error('read ECONNRESET'), {
|
|
213
|
+
code: 'ECONNRESET',
|
|
214
|
+
}),
|
|
215
|
+
})
|
|
216
|
+
baseFetch.mockRejectedValueOnce(error)
|
|
217
|
+
|
|
218
|
+
await expect(createClient().getCMSPagesByContentType('plp')).rejects.toBe(
|
|
219
|
+
error
|
|
220
|
+
)
|
|
221
|
+
expect(baseFetch).toHaveBeenCalledTimes(1)
|
|
222
|
+
})
|
|
223
|
+
|
|
224
|
+
it('retries when a brotli body cannot be decoded', async () => {
|
|
225
|
+
// Node's brotli decoder codes start with `ERR__ERROR_` (double underscore).
|
|
226
|
+
const decodingError = Object.assign(new TypeError('terminated'), {
|
|
227
|
+
cause: Object.assign(new Error('Decompression failed'), {
|
|
228
|
+
code: 'ERR__ERROR_FORMAT_PADDING_1',
|
|
229
|
+
}),
|
|
230
|
+
})
|
|
231
|
+
const page = listingPage(1, 1, 1)
|
|
232
|
+
baseFetch.mockRejectedValueOnce(decodingError).mockResolvedValueOnce(page)
|
|
233
|
+
|
|
234
|
+
const result = await createClient().getCMSPagesByContentType('plp')
|
|
235
|
+
|
|
236
|
+
expect(result).toEqual(page)
|
|
237
|
+
expect(baseFetch).toHaveBeenCalledTimes(2)
|
|
238
|
+
expect(warn.mock.calls[0][0]).toContain(
|
|
239
|
+
'TypeError: ERR__ERROR_FORMAT_PADDING_1'
|
|
240
|
+
)
|
|
241
|
+
})
|
|
242
|
+
|
|
243
|
+
it('reuses the cache-busting value within a window', async () => {
|
|
244
|
+
const now = vi.spyOn(Date, 'now').mockReturnValue(10 * CACHE_BUST_WINDOW_MS)
|
|
245
|
+
const client = createClient()
|
|
246
|
+
const page = listingPage(1, 1, 1)
|
|
247
|
+
baseFetch
|
|
248
|
+
.mockRejectedValueOnce(invalidJSON())
|
|
249
|
+
.mockResolvedValueOnce(page)
|
|
250
|
+
.mockRejectedValueOnce(invalidJSON())
|
|
251
|
+
.mockResolvedValueOnce(page)
|
|
252
|
+
.mockRejectedValueOnce(invalidJSON())
|
|
253
|
+
.mockResolvedValueOnce(page)
|
|
254
|
+
|
|
255
|
+
await client.getCMSPagesByContentType('plp')
|
|
256
|
+
now.mockReturnValue(11 * CACHE_BUST_WINDOW_MS - 1)
|
|
257
|
+
await client.getCMSPagesByContentType('plp')
|
|
258
|
+
now.mockReturnValue(11 * CACHE_BUST_WINDOW_MS)
|
|
259
|
+
await client.getCMSPagesByContentType('plp')
|
|
260
|
+
|
|
261
|
+
expect(paramsOfCall(1)?.get(CACHE_BUST_PARAM)).toBe('10')
|
|
262
|
+
expect(paramsOfCall(3)?.get(CACHE_BUST_PARAM)).toBe('10')
|
|
263
|
+
expect(paramsOfCall(5)?.get(CACHE_BUST_PARAM)).toBe('11')
|
|
264
|
+
})
|
|
265
|
+
|
|
266
|
+
describe('retry cooldown', () => {
|
|
267
|
+
it('fails fast for a URL whose retry also failed', async () => {
|
|
268
|
+
const client = createClient()
|
|
269
|
+
baseFetch.mockRejectedValue(invalidJSON())
|
|
270
|
+
|
|
271
|
+
await expect(
|
|
272
|
+
client.getCMSPagesByContentType('plp')
|
|
273
|
+
).rejects.toBeInstanceOf(SyntaxError)
|
|
274
|
+
expect(baseFetch).toHaveBeenCalledTimes(2)
|
|
275
|
+
|
|
276
|
+
await expect(
|
|
277
|
+
client.getCMSPagesByContentType('plp')
|
|
278
|
+
).rejects.toBeInstanceOf(SyntaxError)
|
|
279
|
+
expect(baseFetch).toHaveBeenCalledTimes(3)
|
|
280
|
+
// One warning for the retry and one for the cooldown.
|
|
281
|
+
expect(warn).toHaveBeenCalledTimes(2)
|
|
282
|
+
expect(warn.mock.calls[1][0]).toContain(
|
|
283
|
+
'Skipping retries for this URL for 60s'
|
|
284
|
+
)
|
|
285
|
+
})
|
|
286
|
+
|
|
287
|
+
it('also backs off when the retry fails with another error', async () => {
|
|
288
|
+
const client = createClient()
|
|
289
|
+
const originError = new Error('Error while fetching')
|
|
290
|
+
baseFetch
|
|
291
|
+
.mockRejectedValueOnce(invalidJSON())
|
|
292
|
+
.mockRejectedValueOnce(originError)
|
|
293
|
+
.mockRejectedValueOnce(invalidJSON())
|
|
294
|
+
|
|
295
|
+
await expect(client.getCMSPagesByContentType('plp')).rejects.toBe(
|
|
296
|
+
originError
|
|
297
|
+
)
|
|
298
|
+
await expect(
|
|
299
|
+
client.getCMSPagesByContentType('plp')
|
|
300
|
+
).rejects.toBeInstanceOf(SyntaxError)
|
|
301
|
+
expect(baseFetch).toHaveBeenCalledTimes(3)
|
|
302
|
+
})
|
|
303
|
+
|
|
304
|
+
it('still retries other URLs', async () => {
|
|
305
|
+
const client = createClient()
|
|
306
|
+
const page = listingPage(2, 10, 20)
|
|
307
|
+
baseFetch
|
|
308
|
+
.mockRejectedValueOnce(invalidJSON())
|
|
309
|
+
.mockRejectedValueOnce(invalidJSON())
|
|
310
|
+
.mockRejectedValueOnce(invalidJSON())
|
|
311
|
+
.mockResolvedValueOnce(page)
|
|
312
|
+
|
|
313
|
+
await expect(
|
|
314
|
+
client.getCMSPagesByContentType('plp')
|
|
315
|
+
).rejects.toBeInstanceOf(SyntaxError)
|
|
316
|
+
await expect(
|
|
317
|
+
client.getCMSPagesByContentType('plp', { page: 2 })
|
|
318
|
+
).resolves.toEqual(page)
|
|
319
|
+
expect(baseFetch).toHaveBeenCalledTimes(4)
|
|
320
|
+
})
|
|
321
|
+
|
|
322
|
+
it('retries the URL again after the cooldown', async () => {
|
|
323
|
+
const now = vi.spyOn(Date, 'now').mockReturnValue(1_000_000)
|
|
324
|
+
const client = createClient()
|
|
325
|
+
const page = listingPage(1, 1, 1)
|
|
326
|
+
baseFetch
|
|
327
|
+
.mockRejectedValueOnce(invalidJSON())
|
|
328
|
+
.mockRejectedValueOnce(invalidJSON())
|
|
329
|
+
.mockRejectedValueOnce(invalidJSON())
|
|
330
|
+
.mockResolvedValueOnce(page)
|
|
331
|
+
|
|
332
|
+
await expect(
|
|
333
|
+
client.getCMSPagesByContentType('plp')
|
|
334
|
+
).rejects.toBeInstanceOf(SyntaxError)
|
|
335
|
+
|
|
336
|
+
now.mockReturnValue(1_000_000 + RETRY_COOLDOWN_MS)
|
|
337
|
+
|
|
338
|
+
await expect(client.getCMSPagesByContentType('plp')).resolves.toEqual(
|
|
339
|
+
page
|
|
340
|
+
)
|
|
341
|
+
expect(baseFetch).toHaveBeenCalledTimes(4)
|
|
342
|
+
// The retry after the cooldown uses a new cache-busting value.
|
|
343
|
+
expect(paramsOfCall(3)?.get(CACHE_BUST_PARAM)).not.toBe(
|
|
344
|
+
paramsOfCall(1)?.get(CACHE_BUST_PARAM)
|
|
345
|
+
)
|
|
346
|
+
})
|
|
347
|
+
|
|
348
|
+
it('lasts at least one cache-busting window', () => {
|
|
349
|
+
expect(RETRY_COOLDOWN_MS).toBeGreaterThanOrEqual(CACHE_BUST_WINDOW_MS)
|
|
350
|
+
})
|
|
351
|
+
})
|
|
352
|
+
|
|
353
|
+
describe('with real HTTP responses', () => {
|
|
354
|
+
// Real `fetch` and `response.json()` against a local server, like
|
|
355
|
+
// `@vtex/client-cms` does, to pin the error shapes the runtime produces.
|
|
356
|
+
// The server answers the bad body until the cache-busting param is sent,
|
|
357
|
+
// and closes each connection so `server.close()` does not wait on sockets.
|
|
358
|
+
const good: ContentPage = { data: [], hasNextPage: false, totalItems: 0 }
|
|
359
|
+
const goodJSON = JSON.stringify(good)
|
|
360
|
+
const badResponses: Record<
|
|
361
|
+
string,
|
|
362
|
+
{ headers: Record<string, string>; body: string | Buffer }
|
|
363
|
+
> = {
|
|
364
|
+
'gzip-without-content-encoding': {
|
|
365
|
+
headers: {},
|
|
366
|
+
body: gzipSync(goodJSON),
|
|
367
|
+
},
|
|
368
|
+
'content-encoding-gzip-on-plain-body': {
|
|
369
|
+
headers: { 'content-encoding': 'gzip' },
|
|
370
|
+
body: goodJSON,
|
|
371
|
+
},
|
|
372
|
+
'content-encoding-br-on-plain-body': {
|
|
373
|
+
headers: { 'content-encoding': 'br' },
|
|
374
|
+
body: goodJSON,
|
|
375
|
+
},
|
|
376
|
+
'html-page': {
|
|
377
|
+
headers: { 'content-type': 'text/html' },
|
|
378
|
+
body: '<html>Error</html>',
|
|
379
|
+
},
|
|
380
|
+
'truncated-json': { headers: {}, body: goodJSON.slice(0, 10) },
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
let server: Server
|
|
384
|
+
let origin = ''
|
|
385
|
+
|
|
386
|
+
beforeAll(async () => {
|
|
387
|
+
server = createServer((req, res) => {
|
|
388
|
+
const url = new URL(req.url ?? '/', 'http://localhost')
|
|
389
|
+
const bad = badResponses[url.pathname.slice(1)]
|
|
390
|
+
|
|
391
|
+
if (bad && !url.searchParams.has(CACHE_BUST_PARAM)) {
|
|
392
|
+
res.writeHead(200, { ...bad.headers, connection: 'close' })
|
|
393
|
+
res.end(bad.body)
|
|
394
|
+
return
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
res.writeHead(200, {
|
|
398
|
+
'content-type': 'application/json',
|
|
399
|
+
connection: 'close',
|
|
400
|
+
})
|
|
401
|
+
res.end(goodJSON)
|
|
402
|
+
})
|
|
403
|
+
await new Promise<void>((resolve) =>
|
|
404
|
+
server.listen(0, '127.0.0.1', resolve)
|
|
405
|
+
)
|
|
406
|
+
origin = `http://127.0.0.1:${(server.address() as AddressInfo).port}`
|
|
407
|
+
})
|
|
408
|
+
|
|
409
|
+
afterAll(async () => {
|
|
410
|
+
await new Promise<void>((resolve) => server.close(() => resolve()))
|
|
411
|
+
})
|
|
412
|
+
|
|
413
|
+
beforeEach(() => {
|
|
414
|
+
baseFetch.mockImplementation(
|
|
415
|
+
async (path?: string, params?: URLSearchParams) => {
|
|
416
|
+
const query = params?.toString()
|
|
417
|
+
const response = await fetch(
|
|
418
|
+
[`${origin}/${path}`, query].filter(Boolean).join('?')
|
|
419
|
+
)
|
|
420
|
+
|
|
421
|
+
if (!response.ok) {
|
|
422
|
+
throw new Error('Error while fetching')
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
return response.json()
|
|
426
|
+
}
|
|
427
|
+
)
|
|
428
|
+
})
|
|
429
|
+
|
|
430
|
+
it.each(Object.keys(badResponses))(
|
|
431
|
+
'retries a %s response',
|
|
432
|
+
async (name) => {
|
|
433
|
+
await expect(
|
|
434
|
+
createClient().getCMSPagesByContentType(name)
|
|
435
|
+
).resolves.toEqual(good)
|
|
436
|
+
expect(baseFetch).toHaveBeenCalledTimes(2)
|
|
437
|
+
}
|
|
438
|
+
)
|
|
439
|
+
})
|
|
440
|
+
|
|
441
|
+
describe('getCMSPage', () => {
|
|
442
|
+
// Page 1 says there are 25 items, so pages 2 and 3 are fetched in
|
|
443
|
+
// parallel. Page 2 answers with an invalid body the first time.
|
|
444
|
+
const mockListingWithOneBadPage = () => {
|
|
445
|
+
let badResponses = 1
|
|
446
|
+
|
|
447
|
+
baseFetch.mockImplementation(async (_path, params) => {
|
|
448
|
+
const page = Number((params as URLSearchParams).get('page'))
|
|
449
|
+
|
|
450
|
+
if (page === 2 && badResponses > 0) {
|
|
451
|
+
badResponses -= 1
|
|
452
|
+
throw invalidJSON()
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
return listingPage(page, page === 3 ? 5 : 10, 25)
|
|
456
|
+
})
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
it('recovers when one page of a listing has an invalid body', async () => {
|
|
460
|
+
mockListingWithOneBadPage()
|
|
461
|
+
|
|
462
|
+
const result = await getCMSPage({ contentType: 'plp' }, createClient())
|
|
463
|
+
|
|
464
|
+
expect(result.data).toHaveLength(25)
|
|
465
|
+
expect(result.data[10].id).toBe('page-2-item-0')
|
|
466
|
+
// Pages 1, 2 and 3, plus the retry of page 2.
|
|
467
|
+
expect(baseFetch).toHaveBeenCalledTimes(4)
|
|
468
|
+
expect(warn).toHaveBeenCalledTimes(1)
|
|
469
|
+
expect(warn.mock.calls[0][0]).toContain('page=2')
|
|
470
|
+
})
|
|
471
|
+
|
|
472
|
+
it('is used by the default CMS client', async () => {
|
|
473
|
+
mockListingWithOneBadPage()
|
|
474
|
+
|
|
475
|
+
const result = await getCMSPage({ contentType: 'plp' }, clientCMS)
|
|
476
|
+
|
|
477
|
+
expect(clientCMS).toBeInstanceOf(ResilientClientCMS)
|
|
478
|
+
expect(result.data).toHaveLength(25)
|
|
479
|
+
expect(baseFetch).toHaveBeenCalledTimes(4)
|
|
480
|
+
})
|
|
481
|
+
})
|
|
482
|
+
})
|