test('whatever', () => {
const foo = someThing()
// use foo
})
makes for a WAY simpler testbase than:
let foo
beforeEach(() => {
foo = someThing()
})
test('whatever', () => {
// use foo
})
Avoid mutable variables. Your tests will be easier to understand