Skip to content

Instantly share code, notes, and snippets.

View mattphillips's full-sized avatar

Matt Phillips mattphillips

View GitHub Profile

Keybase proof

I hereby claim:

  • I am mattphillips on github.
  • I am mattphillips (https://keybase.io/mattphillips) on keybase.
  • I have a public key ASChwRzXw6cEo0kZQMpdnhA1drnJDyeq5PjLhpsS_T1qrgo

To claim this, I am signing this object:

@mattphillips
mattphillips / toBeTrue.js
Last active October 20, 2017 16:59
Jest Extend toBeTrue Matcher example
expect.extend({
toBeTrue(given) {
const pass = given === true;
if (pass) {
return {
message: () => `expected ${given} not to be true`,
pass: true,
};
} else {
return {
@mattphillips
mattphillips / detailedDiffDeletedToNull.js
Last active January 29, 2017 18:30
How to convert detailedDiff deleted undefined values into nulls :)
// this is an example of what may be returned by the detailedDiff function
const detailedDifference = {
added: {
matt: 'phillips',
},
updated: {
hello: 'world',
},
deleted: {
a: {