Skip to content

Instantly share code, notes, and snippets.

@janhesters
Created September 26, 2020 08:55
Show Gist options
  • Save janhesters/72d88e7d54f3b3e7b013963986dd3703 to your computer and use it in GitHub Desktop.
Save janhesters/72d88e7d54f3b3e7b013963986dd3703 to your computer and use it in GitHub Desktop.
Setup with populated state factory function.
{
const summand = 1;
const state = createPopulatedState();
assert({
given: 'state with a count and an increment by action',
should: 'increment the count by the payload',
actual: reducer(state, incrementBy(summand)),
expected: createPopulatedState({ count: 42 /* , ... rest untouched */ }),
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment