Jest: Feature: add aroundAll, aroundEach funcitons

Created on 27 Sep 2017  路  5Comments  路  Source: facebook/jest

Do you want to request a feature or report a bug?
feature

What is the current behavior?
no such functions

What is the expected behavior?
something like

let db = null
aroundAll((next) => {
  db = makeDb()
  next()
  cleanupDb(db)
})

Most helpful comment

before... and after... are not replacements for having an around... callback.
This is needed to run each test within a database transaction for example.

All 5 comments

There is beforeAll or beforeEach.

but no around, which is tidier

before... and after... are not replacements for having an around... callback.
This is needed to run each test within a database transaction for example.

Was this page helpful?
0 / 5 - 0 ratings