Pass/Fail AVA Tests Based on Environment Variables - Code with Hugo - May 6th 2020
Welcome to the 74th Edition of the Code with Hugo newsletter about JavaScript, Node.js & Enterprise patterns.
Here are 3 links I think are worth your time this week,
-
“AVA: pass or fail a test if an environment variable is missing/empty” In a recent project I needed to fail/pass some AVA if a runtime environment variable was unset or empty. (3 min read) : https://codewithhugo.com/ava-pass-fail-test-env-variable/
-
Matthew Walker’s “Why We Sleep” Is Riddled with Scientific and Factual Errors (14 min read): https://guzey.com/books/why-we-sleep/
-
RFC: Adopt a modern JavaScript framework for use with MediaWiki (7 min read): https://phabricator.wikimedia.org/T241180
Bonus link this week to celebrate my first post on CSS Tricks, this was initially titled “What is Alpine.js and why should I care?”, https://css-tricks.com/alpine-js-the-javascript-framework-thats-used-like-jquery-written-like-vue-and-inspired-by-tailwindcss/.
This week, a thread about React hooks by @diegohaz:
Why explicit hook-based APIs:
const toolbar = useToolbarState()
<Toolbar {...toolbar}>
<ToolbarItem {...toolbar} />
</Toolbar>
are better than implicit context-based APIs:
<Toolbar> // Provider
<ToolbarItem /> // Consumer
</Toolbar>
(and why they’re not)
A thread 👇
— Haz (@diegohaz) February 17, 2020
This month I’ve been thinking back through Yuval Noah Hariri’s Sapiens - A brief history of humankind. It’s a history of the human species, what drove us to where we are and reflexions around why. It goes through different historic, socio, geo-political points of view presented in a thought-provoking fashion. It’s a fast-tracked history of the world seen through a socio-behavioural lense. Great read for context around humankind, society and their transformative phases. It also managed to pack a lot of information in a reasonable length, that’s grounds for 4/5 ⭐️ .
That’s all for this week, stay tuned for more JavaScript tips to help you get stuff done.
Hugo