Closed gr2m closed 3 years ago
Going live in 30 minutes at https://twitch.tv/gregorcodes
I'm now live on https://twitch.tv/gregorcodes
It's a wrap! See you next week: https://github.com/gr2m/helpdesk/issues/47
Show is done for today, thank you all! Recording is coming up in a moment
💁🏻 Automating gr2m/helpdesk: Creating tests for actions for faster iteration 📅 Thursday, August 19, 2021 🕐 10:00am Pacific Time 🎙️ no guests 📍 https://www.twitch.tv/gregorcodes 🏷️ testing
Subscribe to this issues to get a notification before the show begins and a summary after the show concludes.
Creating tests for actions for faster iteration
Creating tests for local actions is a huge time saver. It enables quick iteration and avoid regressions once problems occur.
Outline
I will create tests for the existing actions in this repository
TODOs
Before the show
When show begins
After the show
Recording
Shownotes
get-schow-schedules.js
. The final test file:test/get-show-schedules-test.js)
mockdate
for mocking theDate
API, so that tests won't start failing next week :)uvu
as a simple test runner, so that I can run all tests withnpm test
.github/workflows/test.yml
Important takeaway: wrap your lock action scripts like this:
And then your test file can look like this
That way, you can run your tests as part of your CI using GitHub actions, but make sure to set
NODE_END
to"test"