MCPcopy Create free account
hub / github.com/angular/dev-infra / runGraceful

Method runGraceful

ng-dev/utils/testing/virtual-git-client.ts:79–99  ·  view source on GitHub ↗

Override for the actual Git client command execution.

(args: string[], options: SpawnSyncOptions = {})

Source from the content-addressed store, hash-verified

77
78 /** Override for the actual Git client command execution. */
79 override runGraceful(args: string[], options: SpawnSyncOptions = {}): SpawnSyncReturns<string> {
80 const [command, ...rawArgs] = args;
81 switch (command) {
82 case 'push':
83 this._push(rawArgs);
84 break;
85 case 'fetch':
86 this._fetch(rawArgs);
87 break;
88 case 'checkout':
89 this._checkout(rawArgs);
90 break;
91 case 'commit':
92 this._commit(rawArgs);
93 break;
94 }
95
96 // Return a fake spawn sync return value. We error non-gracefully if any command fails
97 // in the tests, so we always return success and stub out the `SpawnSyncReturns` type.
98 return {status: 0, stderr: '', output: [], pid: -1, signal: null, stdout: ''};
99 }
100
101 /** Handler for the `git push` command. */
102 private _push(args: string[]) {

Callers 1

git-client.spec.tsFile · 0.45

Calls 4

_pushMethod · 0.95
_fetchMethod · 0.95
_checkoutMethod · 0.95
_commitMethod · 0.95

Tested by

no test coverage detected