r/angular • • 2d ago • Heartwarming 1

I open-sourced an agent skill for Angular testing, so you might actually enjoy reviewing the tests your coding agents write

Post image

The skill teaches agents how to write behavioral and readable tests:

  • No fixture.whenStable() and fixture.detectChanges() soup. Actually, no more fixture 😊
  • Fakes over mocks: more robust, more readable, and it drastically reduces the cost of mock maintenance for your agents, and you.
  • Through the DOM: test what the user sees, not fixture.my.private.implementation.details
  • Vitest Browser Mode first (jsdom and happy-dom still work)
  • Signals, guards, routing and timers: dedicated guidance for each, like fast-forwarding time instead of hardcoding delays.
  • Migrating from Jest or Karma to Vitest

Try it: npx skills add marmicode/skills -s angular-testing
https://github.com/marmicode/skills#angular-testing

The skill is evaluated on each change to avoid regressions.

A good first step: ask your agent to rewrite one of your existing tests with it.
The skill is evaluated on every change to catch regressions, so if you see anything that could be improved, please open an issue. The more real-world scenarios it covers, the better the skill gets for everyone.

59 Upvotes

15 comments sorted by

5

u/DMezhenskyi 1d ago

Already use it and already love it. Great job, Younes πŸ™ŒπŸ»

4

u/younesjd 1d ago

Oh really! Thanks Dmytro! ❀️

5

u/laradvil 1d ago

I never once tested my codes, but damn this looks tempting. Nice one bruh

1

u/younesjd 1d ago

😊 cool! Hope this will make you and your agents enjoy testing

3

u/MichaelSmallDev 1d ago

Thank you for this. I have been rolling out a new wave of unit testing on our frontend and have been wanting details like this beyond the adev testing docs. I just read all these over and this answers a lot of questions I had about unit testing and vitest in general, so these will make for good skills to have.

1

u/younesjd 1d ago

Awesome! πŸ™Œ
Happy it helps 😊

1

u/Prod_Meteor 2d ago

Do you mean, a tool?

1

u/younesjd 2d ago

It’s just a skill that you add to your workspace (using the `npx skills` skill management tool). The skill gives the right testing instructions to your coding agent (whichever it is)

1

u/Straker741 1d ago

Looks really good! Thank you very much.

1

u/younesjd 1d ago

Thanks πŸ™

1

u/GeromeGrignon 1d ago

Planning to use it for Optimus UI!

1

u/younesjd 1d ago

Cool! Let me know how it goes πŸ™Œ

1

u/makmn1 2d ago

Awesome!!! I learned all I know about modern Angular testing from your Marmicode Cookbook and have been creating / reviewing tests using those patterns for over a year now. I'm definitely going to try out this skill and compare it against my own instructions to see if I can contribute back anything. Thanks Younes!

1

u/younesjd 2d ago

Thank you so much u/makmn1, this really made my day! ❀️

On one hand, I am sorry that I couldn't find time for this before...
on the other hand, there's an upside: you (and probably others) have been refining your own instructions in the meantime, so we now have real-world experience to compare against πŸ™Œ. I'd love to hear what you find, and contributions are more than welcome!

1

u/makmn1 1d ago

Will do! πŸ˜„