refactor(compiler-cli): expose loadTestDirectory() test helper (#36843)
				
					
				
			This helper can be useful in other packages to load files from the real disk into a mock file system. PR Close #36843
This commit is contained in:
		
							parent
							
								
									5d12c19ce9
								
							
						
					
					
						commit
						dbf1f6b233
					
				| @ -8,6 +8,7 @@ ts_library( | |||||||
|     srcs = glob([ |     srcs = glob([ | ||||||
|         "**/*.ts", |         "**/*.ts", | ||||||
|     ]), |     ]), | ||||||
|  |     module_name = "@angular/compiler-cli/test/helpers", | ||||||
|     deps = [ |     deps = [ | ||||||
|         "//packages:types", |         "//packages:types", | ||||||
|         "//packages/compiler-cli/src/ngtsc/file_system", |         "//packages/compiler-cli/src/ngtsc/file_system", | ||||||
|  | |||||||
| @ -66,7 +66,8 @@ export function loadFakeCore(fs: FileSystem, basePath: string = '/') { | |||||||
|  * @param directoryPath the path to the directory we want to load. |  * @param directoryPath the path to the directory we want to load. | ||||||
|  * @param mockPath the path within the mock file-system where the directory is to be loaded. |  * @param mockPath the path within the mock file-system where the directory is to be loaded. | ||||||
|  */ |  */ | ||||||
| function loadTestDirectory(fs: FileSystem, directoryPath: string, mockPath: AbsoluteFsPath): void { | export function loadTestDirectory( | ||||||
|  |     fs: FileSystem, directoryPath: string, mockPath: AbsoluteFsPath): void { | ||||||
|   readdirSync(directoryPath).forEach(item => { |   readdirSync(directoryPath).forEach(item => { | ||||||
|     const srcPath = resolve(directoryPath, item); |     const srcPath = resolve(directoryPath, item); | ||||||
|     const targetPath = fs.resolve(mockPath, item); |     const targetPath = fs.resolve(mockPath, item); | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user