mastouille.fr est l'un des nombreux serveurs Mastodon indépendants que vous pouvez utiliser pour participer au fédiverse.
Mastouille est une instance Mastodon durable, ouverte, et hébergée en France.

Administré par :

Statistiques du serveur :

679
comptes actifs

#mocking

0 message0 participant0 message aujourd’hui

I apparently missed this post from @maelle on #mocking #tests in #RStats packages, specifically recommending `testthat::local_mocked_bindings()` over `mockery::stub()` and giving a clear example of how to mock base functions.

blog.r-hub.io/2024/03/21/mocki

Very pertinent today as one of the codebases I'm working on used `mockery::stub()` and my colleague found that it was leaking to other tests in a pattern that could only be described as...

vicious mockery (roll 1d4 for damage)

blog.r-hub.ioUpdate on mocking for testing R packages - R-hub blogThis blog featured a post on mocking, the art of replacing a function with whatever fake we need for testing, years ago. Since then, we’ve entered a new decade, the second edition of Hadley Wickham’s and Jenny Bryan’s R packages book was published, and mocking returned to testthat, so it’s time for a new take/resources roundup! Thanks a lot to Hannah Frick for useful feedback on this post!

I'm looking for a way to test my #PHP #Symfony application #BehaviourDriven using #TDD without getting into DI #mocking hell. Currently ~90% of my tests consist of (mockery) mocks and their expectations. Are there ways/approaches to reduce this mocking on unit test level and focus more on the expected behaviour of the functions without having to constantly adapt the mocks during refactorings?

Any ideas/ tools/ articles/ videos/ composer packages?

Suite du fil

…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.

Audience laughs as SNP’s leader Stephen Flynn mocks Nigel Farage at BBC debate

It came after the SNP Westminster leader answered a question about immigration during the seven-way BBC election debate.

Farage then said he wanted to inject some “logic” into the discussion, to which Flynn replied: “That would be a novelty for you.”

This led to laughs in the audience.

thenational.scot/news/24374652

The National · Audience laughs as Stephen Flynn mocks Nigel Farage at BBC debatePar James Walker