Created
August 9, 2020 19:05
-
-
Save tsmx/feb3748be5ba62a0164d575adb4b9368 to your computer and use it in GitHub Desktop.
Jest: set environment variable for all tests via configuration file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// MY_VAR is available in all Jest tests and suites, no need to adapt the before() or beforeAll() functions | |
process.env['MY_VAR'] = 'My-Var-value'; | |
module.exports = { | |
testEnvironment: 'node' | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment