Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(workers/global): check git at startup (#12935)
- Loading branch information
1 parent
3a5ad66
commit 3fa21fb
Showing
4 changed files
with
73 additions
and
0 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { git } from '../../../test/util'; | ||
import type { RenovateConfig } from '../../config/types'; | ||
import { globalInitialize } from './initialize'; | ||
|
||
jest.mock('../../util/git'); | ||
|
||
describe('workers/global/initialize', () => { | ||
describe('checkVersions()', () => { | ||
it('throws if invalid version', async () => { | ||
const config: RenovateConfig = {}; | ||
git.validateGitVersion.mockResolvedValueOnce(false); | ||
await expect(globalInitialize(config)).rejects.toThrow(); | ||
}); | ||
|
||
it('returns if valid git version', async () => { | ||
const config: RenovateConfig = {}; | ||
git.validateGitVersion.mockResolvedValueOnce(true); | ||
await expect(globalInitialize(config)).toResolve(); | ||
}); | ||
}); | ||
}); |
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