@rushstack/heft
Version:
Build all your JavaScript projects the same way: A way that works.
29 lines • 777 B
JavaScript
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
// See LICENSE in the project root for license information.
/**
* Implementation of IScopedLogger for use by unit tests.
*
* @internal
*/
export class MockScopedLogger {
constructor(terminal) {
this.errors = [];
this.warnings = [];
this.loggerName = 'mockLogger';
this.terminal = terminal;
}
get hasErrors() {
return this.errors.length > 0;
}
emitError(error) {
this.errors.push(error);
}
emitWarning(warning) {
this.warnings.push(warning);
}
resetErrorsAndWarnings() {
this.errors.length = 0;
this.warnings.length = 0;
}
}
//# sourceMappingURL=MockScopedLogger.js.map