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
  • 98,250
  • 56
  • 262
  • 287
lamartire
  • 101
  • 1

0 Answers0