jest icon indicating copy to clipboard operation
jest copied to clipboard

[Bug]: global object is not usable in globalTearDown file

Open shivamconan opened this issue 1 year ago • 0 comments

Version

29.7

Steps to reproduce

  1. Define globals in jest.config -
globalTeardown: '../teardown.js',
globals: {
   variable1: 'value1'
 },
  1. Try to use global object in teardown file (throws undefined) - ${this.global.variable1}

Expected behavior

I should be able to use fields defined in config file on globals object in teardown file just like I use in test files.

Actual behavior

accessing field throws undefined

Additional context

No response

Environment

OS: Mac M1

shivamconan avatar Jun 23 '24 10:06 shivamconan