0

When I use jest with common functions, I have access to test object in this.

afterEach(function() {
  return this.hello; // 'Hello world!'
})

it(function() {
  this.hello = 'Hello world!';
})

When I use arrow functuions this means global context.

How I can access to test object, when I use arrow functions?

Andreas Köberle
  • 106,652
  • 57
  • 273
  • 297
lamartire
  • 101
  • 1

0 Answers0