Hacker Newsnew | past | comments | ask | show | jobs | submit | howToTestFE's commentslogin

Site/course on teaching how to write tests, mostly about frontend tests in React but also just generally things like Vitest/Jest https://howtotestfrontend.com/courses/jest-vitest-fundamenta...


+1 very confusing name for another mongodb compatible db.


Yep. I think there are so many new apps, when I run a `npx skills add ...` , the list of what tools (like claude code, open code, etc) to install skills in is getting larger every time I use it.

I will check it out though.


100%. its a horrible code smell, and AI loves to jest.mock (or vi.mock()). (The most recent blog post on my site covers this as one of the things to look out for in AI generated tests...)

in JS (with Jest/Vitest) it is far too easy to call mock()...


i view this as the strength of dynamic language like JS or Ruby rather than a weakness: look at all the busywork a language like Java would otherwise inflict on us that we’re able to avoid. it takes a single syntactic lint rule to enforce type safe use of these module mock APIs (enforce `testlib.mock<typeof import(P)>(P, …)`), and only about 100 lines of one time setup to add mock helpers in vitest to mock a specific export rather than the whole module. There are also lint rules that prevent pretty much all scoping problem misuse of hoisted apis like testlib.mock.

Your course should mention these techniques! Without them tests are unsound!

We do some dependency injection of our framework-level service objects like ServerApiService or RouterService or RecordCacheService (usually with a subclass of the actual implementation) but it hardly needs to be ubiquitous or typical for product developer code.


> 100%. its a horrible code smell (...)

It's a testing technique used particularly in legacy projects called characterization tests. If you are faced with covering with tests a component you didn't wrote and you don't want to introduce a regression when refactoring it, you just mock existing function calls to assert observable behavior.

In compiled languages such as C++ this is even done with link time stubs.

Calling it code smell conveys the idea you are inexperienced and lack any experience managing test coverage.


yup vitest is great (my default choice for new projects).

vitest browser mode is really nice too. (new-ish feature, although at this point it isn't exactly new).


learn step by step the main features of both Jest and Vitest (they're very similar for most common usages) in these interactive4 lessons


Blog post comparing Vitest vs Jest


not sure how interesting to others, but i thought this was really cool.

(I am not affiliated with posthog at all. Just typed an incorrect address and came across it.)


Has anyone got any good resources for something like this? I haven't touched C in years, and never worked on anything game-like. But it does look like a really interesting project to start something like this.


If you have patience, the first 30 or so episodes of Handmade Hero are pretty good.

https://guide.handmadehero.org/code/


Handmade Hero is a bad idea for anyone wanting to learn how to make a game in C or C++. Casey intentionally avoids using standard libraries and frameworks and his irrational hatred of high-level code and modern standards will lead developers astray and waste their time.

Even if you're using C you don't need to implement your own renderer or do half the things he does. Get a library like SDL3 to handle the basics, maybe use Lua/LuaJIT for scripting. Learn OpenGL or Vulkan. Stay away from HH and Casey Muratori until you're experienced enough to tell the difference between his wisdom and his bullshit.


We'll have to agree to disagree on this one.


raylib is one possible starting place. Also might look at dos-like (https://mattiasgustavsson.itch.io/dos-like).


tldr - `tsc` can be replaced with `tsgo`. `eslint` replaced by `oxlint`, and `prettier` replaced with `oxfmt


Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: