/
githubmirror
/
angular-cli
Обзор
Документация
Войти
/
githubmirror
/
angular-cli
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
packages/angular/cli/src/commands/mcp/testing/mock-host.ts
25 строк
995 B
Charles Lyding
refactor(@angular/cli): restrict MCP host process spawning to Angular CLI executable
08 май 2026, 17:04
08 май 2026, 17:04
240936d
Код
Авторство
О чём код?
/** * @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 { executeNgCommand = jasmine.createSpy('executeNgCommand').and.resolveTo({ logs: [] }); stat = jasmine.createSpy('stat'); existsSync = jasmine.createSpy('existsSync'); readFile = jasmine.createSpy('readFile').and.resolveTo(''); glob = jasmine.createSpy('glob').and.returnValue((async function* () {})()); startNgProcess = jasmine.createSpy('startNgProcess'); getAvailablePort = jasmine.createSpy('getAvailablePort'); isPortAvailable = jasmine.createSpy('isPortAvailable').and.resolveTo(true); setRoots = jasmine.createSpy('setRoots'); }