forked from angular/angular-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmock-host.ts
More file actions
21 lines (19 loc) · 716 Bytes
/
mock-host.ts
File metadata and controls
21 lines (19 loc) · 716 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/
import type { Host } from '../host';
/**
* A mock implementation of the `Host` interface for testing purposes.
* This class allows spying on host methods and controlling their return values.
*/
export class MockHost implements Host {
runCommand = jasmine.createSpy('runCommand').and.resolveTo({ stdout: '', stderr: '' });
stat = jasmine.createSpy('stat');
existsSync = jasmine.createSpy('existsSync');
spawn = jasmine.createSpy('spawn');
getAvailablePort = jasmine.createSpy('getAvailablePort');
}