4
okay
3y

My fellow developer was given a responsibility of writing unit test cases.
And instead of mocking the db calls he ended up making actual calls to db and adding realtime data to firestore everytime a test runs. Also he used mocha for the same. When i told him that we need to mock the db calls he said he will use sinon.js for the same and for code coverage his plans were to use istanbul.
I was like FUCKKKKKKK. , why the fk you aren't using jest. I mean whyyyyyyyy. WHAT THE FK

Comments
  • 1
    And why not sqlite :memory: wtf
  • 3
    Saves times creating mock data!
  • 1
    Jest is slow as fuck, React-centric, bloated and copyright Facebook and affiliates. And just try to do a console.log during a test run.. Mocha, sinon and nyc (istanbul) work well together or independently and by using them you support real OSS devs.

    But making mutations in unit tests to the DB in prod is fucked up regardless of your stack ;)
  • 1
    @webketje am feeling guilt now 🥲
Add Comment