Skip to content

Instantly share code, notes, and snippets.

Sandro Padin spadin

Block or report user

Report or block spadin

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
joshdover /
Last active Dec 14, 2019
Idiomatic React Testing Patterns

Idiomatic React Testing Patterns

Testing React components seems simple at first. Then you need to test something that isn't a pure interaction and things seem to break down. These 4 patterns should help you write readable, flexible tests for the type of component you are testing.


I recommend doing all setup in the most functional way possible. If you can avoid it, don't set variables in a beforeEach. This will help ensure tests are isolated and make things a bit easier to reason about. I use a pattern that gives great defaults for each test example but allows every example to override props when needed:

KushalP / .tmux.reset.conf
Created Aug 14, 2013
If someone's added their own tmux config in /etc/tmux.conf this will reset all key bindings to the default for tmux
View .tmux.reset.conf
# First remove *all* keybindings
unbind-key -a
# Now reinsert all the regular tmux keys
bind-key C-b send-prefix
bind-key C-o rotate-window
bind-key C-z suspend-client
bind-key Space next-layout
bind-key ! break-pane
bind-key \" split-window
You can’t perform that action at this time.