Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
shivamconan opened this issue Jun 23, 2024 · 4 comments
Closed

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

shivamconan opened this issue Jun 23, 2024 · 4 comments

Comments

@shivamconan
Copy link

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
Copy link

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 30 days.

@github-actions github-actions bot added the Stale label Jul 23, 2024
Copy link

This issue was closed because it has been stalled for 30 days with no activity. Please open a new issue if the issue is still relevant, linking to this one.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Aug 22, 2024
Copy link

This issue was closed because it has been stalled for 30 days with no activity. Please open a new issue if the issue is still relevant, linking to this one.

Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant