Why should we not just replace beforeAll(function(){ let foo = 'test' }) with let foo = 'test' ? What's the purpose of beforeAll if the second way is fine?
Here's the official definition by the way: The beforeAll function executes once and only once for the describe block containing it, before any of the beforeEach functions or any of the specs.