diff --git a/packages/compiler-cli/src/ngtsc/file_system/testing/src/test_helper.ts b/packages/compiler-cli/src/ngtsc/file_system/testing/src/test_helper.ts index d90af9c89f..28bd7b7bdd 100644 --- a/packages/compiler-cli/src/ngtsc/file_system/testing/src/test_helper.ts +++ b/packages/compiler-cli/src/ngtsc/file_system/testing/src/test_helper.ts @@ -66,10 +66,11 @@ runInEachFileSystem.unix = (callback: (os: string) => void) => runInEachFileSystem.windows = (callback: (os: string) => void) => runInFileSystem(FS_WINDOWS, callback, true); -export function initMockFileSystem(os: string, cwd?: AbsoluteFsPath): void { +export function initMockFileSystem(os: string, cwd?: AbsoluteFsPath): MockFileSystem { const fs = createMockFileSystem(os, cwd); setFileSystem(fs); monkeyPatchTypeScript(os, fs); + return fs; } function createMockFileSystem(os: string, cwd?: AbsoluteFsPath): MockFileSystem {