Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Why was context removed in a point release? #2468
Do you want to request a feature or report a bug?
What is the current behavior?
I have a test suite that was working fine with Jest 18.0. When I upgraded to Jest 18.1, many of my tests started failing with the message, "ReferenceError: context is not defined".
It appears that
It seems like such a breaking change should not have been introduced in a point release.
If the current behavior is a bug, please provide the steps to reproduce and either a repl.it demo through https://repl.it/languages/jest or a minimal repository on GitHub that we can
What is the expected behavior?
My understanding was that
In many situations, I find
I would like to see the
Please provide your exact Jest configuration and mention your Jest, node, yarn/npm version and operating system.
Context was controversial when it was added in #1632. We are currently rewriting the documentation of Jest and were analyzing the globals we add and realized context was almost entirely unused so we decided to remove this alias again. If you'd like to bring it back, you can do
As to why this happened in a minor, here is what happened:
@cpojer Thanks for the response. First, let me apologize for the tone of my original issue. I didn't spend enough time on it, and it came across sounding much harsher than I intended. I'm also sorry that you had to give up some vacation time to deal with an issue caused by someone else's change. I really appreciate the work you all have done on this project. It's because of that work that I'm even looking at Jest as an option.
I had thought about the
That said, I understand your reasoning for dropping it, though I disagree. And I understand the unfortunate circumstances that resulted in that happening on a point release. I'm not a big fan of multiple release tracks, so I wouldn't suggest you make your process more complicated than it is.
Again, thanks everyone for your work on the project!