Skip to content

Instantly share code, notes, and snippets.

/**
* I have recently started to embrace TDD or BDD or whatever we are calling it today. I was
* hoping for some feedback on my how I am structuring my tests. Currently I am writing
* functional tests for my API routes. One thing I dislike is that I have included a global
* data object in each file and beforeEach test generating json web tokens for auth purposes.
* I could probably move that actual logic to some test helper but I still have to store
* this global (for the page) object. Just trying to some feedback. Any advice, even
* unrelated to this, is gladly appreciated.
*/