Jest: How to prevent Jest from polluting global env

Created on 4 Nov 2016  路  2Comments  路  Source: facebook/jest

I would like to use things like beforeEach, afterEach, describe, it, from jest namespace.

Like jest.beforeEach, jest.afterEach, etc..
How would i do that? Is there any configuration option?

Most helpful comment

Right now we have no plans to change this. We may eventually in the future.

All 2 comments

Those features come from Jasmine (https://jasmine.github.io/), which is used under the covers in Jest.

Are you trying to use them independently in a function, or are you looking to prevent them being declared globally. If the latter, why are you looking to achieve this?

Right now we have no plans to change this. We may eventually in the future.

Was this page helpful?
0 / 5 - 0 ratings