jest
jest copied to clipboard
[Bug]: global object is not usable in globalTearDown file
Version
29.7
Steps to reproduce
- Define globals in jest.config -
globalTeardown: '../teardown.js',
globals: {
variable1: 'value1'
},
- 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