Skip to content

Instantly share code, notes, and snippets.

View marcuslindfeldt's full-sized avatar

Marcus Lindfeldt marcuslindfeldt

View GitHub Profile

Keybase proof

I hereby claim:

  • I am marcuslindfeldt on github.
  • I am marcuslindfeldt (https://keybase.io/marcuslindfeldt) on keybase.
  • I have a public key ASBeqNM4xDsfxS8rlNqVmCgz6khbcx8-WwqFng-hjElenAo

To claim this, I am signing this object:

@marcuslindfeldt
marcuslindfeldt / mockVisit.js
Created July 30, 2018 12:43
Cypress PollyJS fetch mock
const uuidV4 = require('uuid/v4');
import { Polly } from '@pollyjs/core';
import FetchAdapter from '@pollyjs/adapter-fetch';
import LocalStoragePersister from '@pollyjs/persister-local-storage';
Polly.register(FetchAdapter);
Polly.register(LocalStoragePersister);
Cypress.Commands.add('mockVisit', (url, mocks = () => null, options) => {
return cy.visit(