fix(action image): 安裝 git 供前置遠端驗證使用
This commit is contained in:
@@ -300,6 +300,15 @@ describe('verifyRemoteAccess', () => {
|
||||
assert.match(result.error, /could not read Username/);
|
||||
});
|
||||
|
||||
it('reports a clear failure when git is not installed', () => {
|
||||
const enoent = new Error('spawnSync git ENOENT');
|
||||
enoent.code = 'ENOENT';
|
||||
const spawn = () => ({ status: null, stdout: '', stderr: '', error: enoent });
|
||||
const result = verifyRemoteAccess(workspace, spawn);
|
||||
assert.equal(result.ok, false);
|
||||
assert.match(result.error, /找不到 git 指令/);
|
||||
});
|
||||
|
||||
it('cleans up the askpass script after running', () => {
|
||||
verifyRemoteAccess(workspace, () => ({ status: 0, stdout: '', stderr: '', error: null }));
|
||||
const leftover = fs.readdirSync(workspace).filter(f => f.endsWith('.git-askpass.sh'));
|
||||
|
||||
Reference in New Issue
Block a user