Andrew E. Rhyne
Aug 28, 2017 · 1 min read

It’s impossible to set up / tear down with pure functions. The inherent function of set up / tear down is to apply side effects such as stubbing out dependencies etc. Doing this inside your teat function is no different. Good luck writing integration tests any other way. Sounds like a recipe for overengineering than it does for clean code. I’ve never had an issue using beforeEach/afterEach with Mocha. It’s canonical. I’d love to see some examples that highlight the benefit. Right now this arguments sounds like FP religion

)

    Andrew E. Rhyne

    Written by

    Founder & CEO @BoltSourceIO