shakedown.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
A community for live music fans with roots in the jam scene. Shakedown Social is run by a team of volunteers (led by @clifff and @sethadam1) and funded by donations.

Administered by:

Server stats:

267
active users

#mocking

0 posts0 participants0 posts today

HowNot2 mock in Deno

Mocking functions in deno is very limited, compared to NodeJS. Maybe, it's so bad that it's actually great. As your resident ruby-hater-in-chief, I'm here to tell you that code "magically working" comes at great cost. Today we're going to learn about why modern javascript broke mocking, and why Deno refused to create magic to pretend otherwise.

terminal.space/tech/hownot2-mo

Continued thread

…but in case any of you want to do something similar, here’s me mocking a WritableStream using a Proxy to provide mock stdout and stderr streams to Console instances to capture the output and save them in my database:

codeberg.org/kitten/app/src/br

And here’s the actual monkeypatching code:

codeberg.org/kitten/app/src/br

Codeberg.orgapp/src/Logs.js at logsapp - A web development kit that’s small, purrs, and loves you.