github-desktop/app/test/unit-test-env.ts
nate smith 3393dbeb3d ignore global config in unit tests by unsetting HOME
This commit unsets both HOME and USERPROFILE for unit tests, thus
isolating us from falling back to a gitconfig in a user's home
directory.
2019-08-22 13:37:37 -05:00

14 lines
451 B
TypeScript

const environmentVariables = {
// setting commit information so that tests don't need to rely on global config
GIT_AUTHOR_NAME: 'Joe Bloggs',
GIT_AUTHOR_EMAIL: 'joe.bloggs@somewhere.com',
GIT_COMMITTER_NAME: 'Joe Bloggs',
GIT_COMMITTER_EMAIL: 'joe.bloggs@somewhere.com',
// signalling to dugite to use the bundled Git environment
TEST_ENV: '1',
HOME: '',
USERPROFILE: '',
}
process.env = { ...process.env, ...environmentVariables }