mirror of
https://github.com/renovatebot/renovate.git
synced 2026-11-02 10:33:39 +00:00
289e2d2028
* fix(git): allow overriding `GIT_ASKPASS` * fix: drop experimental options * test: fix tests
44 lines
1.2 KiB
TypeScript
44 lines
1.2 KiB
TypeScript
import { GlobalConfig } from '../../config/global.ts';
|
|
import { setNoVerify, simpleGitConfig } from './config.ts';
|
|
|
|
describe('util/git/config', () => {
|
|
beforeEach(() => {
|
|
GlobalConfig.reset();
|
|
});
|
|
|
|
it('uses "close" events, ignores "exit" events from child processes', () => {
|
|
expect(simpleGitConfig()).toEqual({
|
|
completion: { onClose: true, onExit: false },
|
|
config: ['core.quotePath=false'],
|
|
unsafe: {
|
|
allowUnsafeAskPass: true,
|
|
allowUnsafeSshCommand: true,
|
|
allowUnsafeConfigEnvCount: true,
|
|
},
|
|
});
|
|
});
|
|
|
|
it('uses timeout value from GlobalConfig', () => {
|
|
GlobalConfig.set({ gitTimeout: 50000 });
|
|
expect(simpleGitConfig()).toEqual({
|
|
completion: { onClose: true, onExit: false },
|
|
timeout: {
|
|
block: 50000,
|
|
},
|
|
config: ['core.quotePath=false'],
|
|
unsafe: {
|
|
allowUnsafeAskPass: true,
|
|
allowUnsafeSshCommand: true,
|
|
allowUnsafeConfigEnvCount: true,
|
|
},
|
|
});
|
|
});
|
|
|
|
it('throws', () => {
|
|
// @ts-expect-error -- testing invalid input
|
|
expect(() => setNoVerify(1)).toThrow(
|
|
'config error: gitNoVerify should be an array of strings',
|
|
);
|
|
});
|
|
});
|