Skip to content

Instantly share code, notes, and snippets.

Miles Spoor lededje

Block or report user

Report or block lededje

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@lededje
lededje / testSetup.js
Created Jan 8, 2018
This is a gist that patches react-native's components and apis with jest to allow you to use Enzyme's react 16 adapter
View testSetup.js
import React from 'react';
jest.mock('react-native', () => {
const createMockComponent = (name) => {
const mockedComponent = ({ children }) => (
<div>{children}</div>
);
mockedComponent.displayName = name;
return mockedComponent;
}
@lededje
lededje / gist:44aeddf1dc2a5e6064e3b29dc35a7a2d
Last active May 29, 2018
Jest Mocking Moment to *always* be utc for tests
View gist:44aeddf1dc2a5e6064e3b29dc35a7a2d
jest.mock('moment', () => {
const moment = require.requireActual('moment');
return moment.utc;
});
View gist:6fe69ef73bd1bb45cf58

Keybase proof

I hereby claim:

  • I am lededje on github.
  • I am lededje (https://keybase.io/lededje) on keybase.
  • I have a public key whose fingerprint is 7981 C178 F6FD 904A 4C5E B601 B931 4CB7 B960 0807

To claim this, I am signing this object:

You can’t perform that action at this time.