You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Importing as a side effect is non obvious.
Many formatters will automatically put import statements at the top of the document. This makes it so that if we want to setup the global ngJest, which should be before the import, so it's accessible to the setup:
🚀 Feature Proposal
In the current setup, we import the setup file, and it executes as a side effect:
I would like instead to be able to import it as a function:
Motivation
Importing as a side effect is non obvious.
Many formatters will automatically put import statements at the top of the document. This makes it so that if we want to setup the global
ngJest
, which should be before the import, so it's accessible to the setup:After formatting it goes under the import:
Rendering it effectively useless.
By having it as a function, we can circumvents that problem by calling it when we're ready:
Additionally, it opens the possibility to pass that config as a parameter, instead of having to set the (untyped) global:
Currently, my other workaround is to set the
globals
in the jest config (which is maybe a better option anyway)Example
No response
The text was updated successfully, but these errors were encountered: