| 
									
										
										
										
											2020-01-10 09:54:58 +00:00
										 |  |  | /** | 
					
						
							|  |  |  |  * @license | 
					
						
							| 
									
										
										
										
											2020-05-19 12:08:49 -07:00
										 |  |  |  * Copyright Google LLC All Rights Reserved. | 
					
						
							| 
									
										
										
										
											2020-01-10 09:54:58 +00:00
										 |  |  |  * | 
					
						
							|  |  |  |  * Use of this source code is governed by an MIT-style license that can be | 
					
						
							|  |  |  |  * found in the LICENSE file at https://angular.io/license
 | 
					
						
							|  |  |  |  */ | 
					
						
							| 
									
										
										
										
											2020-12-30 17:03:41 +00:00
										 |  |  | import {PathManipulation} from '../../../src/ngtsc/file_system'; | 
					
						
							| 
									
										
										
										
											2020-03-04 12:49:36 +00:00
										 |  |  | import {LockFile} from '../../src/locking/lock_file'; | 
					
						
							| 
									
										
										
										
											2020-01-10 09:54:58 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-03-04 12:35:52 +00:00
										 |  |  | /** | 
					
						
							|  |  |  |  * A mock implementation of `LockFile` that just logs its calls. | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | export class MockLockFile implements LockFile { | 
					
						
							|  |  |  |   constructor( | 
					
						
							| 
									
										
										
										
											2020-12-30 17:03:41 +00:00
										 |  |  |       fs: PathManipulation, private log: string[] = [], public path = fs.resolve('/lockfile'), | 
					
						
							| 
									
										
										
										
											2020-03-04 12:35:52 +00:00
										 |  |  |       private pid = '1234') {} | 
					
						
							| 
									
										
										
										
											2020-04-06 08:30:08 +01:00
										 |  |  |   write() { | 
					
						
							|  |  |  |     this.log.push('write()'); | 
					
						
							|  |  |  |   } | 
					
						
							| 
									
										
										
										
											2020-03-04 12:35:52 +00:00
										 |  |  |   read(): string { | 
					
						
							|  |  |  |     this.log.push('read()'); | 
					
						
							|  |  |  |     return this.pid; | 
					
						
							| 
									
										
										
										
											2020-02-03 20:25:15 +00:00
										 |  |  |   } | 
					
						
							| 
									
										
										
										
											2020-04-06 08:30:08 +01:00
										 |  |  |   remove() { | 
					
						
							|  |  |  |     this.log.push('remove()'); | 
					
						
							|  |  |  |   } | 
					
						
							| 
									
										
										
										
											2020-02-03 20:25:15 +00:00
										 |  |  | } |