News for hackers. Stuff that matters.
Re:Delightful React file/directory structure by gherkinnn on Tuesday March 15, 2022 @04:17PM (#30690972)
That's exactly what Deno does [0] in its standard library. Colocate tests with code. It just works.

Some people also like to go further the bad way and group code by type rather than feature.

    src/
        components/
            componentA.tsx
            componentB.tsx
        hooks/
            hookA.ts
            hookB.ts
        tests/
            componentA.test.tsx
            componentB.test.tsx
Angular pre 1.5 liked this a lot. Must be a Java thing.

https://deno.land/[email protected]/collections

Re:Delightful React file/directory structure by azemetre on Wednesday March 16, 2022 @10:13AM (#30699094)
I do wonder if it's Java as well, I've never been exposed to that ecosystem but it seems many bad (IMO at least) practices seem to originate from Java.

Another one I despise is the page object pattern for E2E tests. Basically introducing a pseudo-DSL tied to something that is ever changing. I like the Cypress approach of using app actions instead:

https://www.cypress.io/blog/2019/01/03/stop-using-page-objec...

I utilize this in my playwright tests since I found it very useful when writing cypress tests previously.