Pete Bacon Darwin d100a15998 refactor(compiler-cli): update to use new file-system interfaces (#40281)
Now that `ReadonlyFileSystem` and `PathManipulation` interfaces are
available, this commit updates the compiler-cli to use these more
focussed interfaces.

PR Close #40281
2021-01-08 09:34:44 -08:00

29 lines
753 B
TypeScript

/**
* @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.io/license
*/
import {PathManipulation} from '../../../src/ngtsc/file_system';
import {LockFile} from '../../src/locking/lock_file';
/**
* A mock implementation of `LockFile` that just logs its calls.
*/
export class MockLockFile implements LockFile {
constructor(
fs: PathManipulation, private log: string[] = [], public path = fs.resolve('/lockfile'),
private pid = '1234') {}
write() {
this.log.push('write()');
}
read(): string {
this.log.push('read()');
return this.pid;
}
remove() {
this.log.push('remove()');
}
}