Skip to content

Instantly share code, notes, and snippets.

View robwise's full-sized avatar

Rob Wise robwise

View GitHub Profile
@robwise
robwise / jestSetup.js
Created March 13, 2017 01:45
Extend Jest Expect with Moment.js Matcher
import moment from 'moment';
import diff from 'jest-diff';
// see: https://facebook.github.io/jest/docs/expect.html#expectextendmatchers
expect.extend({
toEqualDate(unparsedReceived, unparsedExpected) {
const received = moment(unparsedReceived);
const expected = moment(unparsedExpected);
const receivedAsString = received.format('L');
@robwise
robwise / reviewable_shorcuts.json
Last active February 28, 2018 01:49
Custom Reviewable Shortcuts
[
["f", "Show next/latest diffs", "setProposedRevRanges()"],
[null, "Next unreviewed file", "nextUnreviewedFile()"],
[null, "Previous unreviewed file", "prevUnreviewedFile()"],
[".", "Next personally unreviewed file", "nextPersonallyUnreviewedFile()"],
[",", "Previous personally unreviewed file", "prevPersonallyUnreviewedFile()"],
[null, "Next changed file", "nextChangedFile()"],
[null, "Previous changed file", "prevChangedFile()"],
[null, "Next visible file", "nextVisibleFile()"],