Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.then(({ body: cart }) => {
expect(cart).toHaveProperty('anonymousId', anonymousId)
// fetch another token with the refresh token flow
const userConfig = {
...apiConfig,
refreshToken: tokenObject.refresh_token,
fetch,
}
const client = createClient({
middlewares: [
createAuthMiddlewareForRefreshTokenFlow(userConfig),
httpMiddleware,
],
})
return client.execute({
// fetch all carts tied to the anonymous token, if cart is present,
// then the cart belongs to the same anonymousId
uri: `/${projectKey}/me/carts`,
method: 'GET',
})
})
.then(