Skip to content

Instantly share code, notes, and snippets.

View nickells's full-sized avatar
🤷‍♂️
git

Nick Elʪworth nickells

🤷‍♂️
git
View GitHub Profile
@fokusferit
fokusferit / enzyme_render_diffs.md
Last active June 18, 2024 11:27
Difference between Shallow, Mount and render of Enzyme

Shallow

Real unit test (isolation, no children render)

Simple shallow

Calls:

  • constructor
  • render
@glcheetham
glcheetham / strategy-pattern.js
Last active December 13, 2017 22:27
Strategy Pattern JS example
// Example. Let's sort the apples, pears, and oranges into the right baskets.
const fruits = ["apple", "pear", "apple", "apple", "orange", "pear", "orange", "pear", "apple"]
let appleBasket = []
let pearBasket = []
let orangeBasket = []
let strategies = []
const appleSortStrategy = (fruit) => {