feat: tests

This commit is contained in:
2023-04-21 12:08:35 +02:00
parent 8cb9285462
commit d8c79256c9
140 changed files with 2100 additions and 2693 deletions

View File

@@ -1,9 +1,9 @@
export * from './logger.js'
export * from './common.js'
export * from './smtp.js'
export * from './transformation.js'
export * from './transport.js'
export * from './logger.js';
export * from './common.js';
export * from './smtp.js';
export * from './transformation.js';
export * from './transport.js';
export * from './transformations/add-log-level.js'
export * from './transformations/colorize.js'
export * from './transformations/timestamp.js'
export * from './transformations/add-log-level.js';
export * from './transformations/colorize.js';
export * from './transformations/timestamp.js';

View File

@@ -13,6 +13,8 @@
* this program. If not, see <https://www.gnu.org/licenses/>.
*/
import chalk from 'chalk';
// eslint-disable-next-line unicorn/import-style
import type {ChalkInstance} from 'chalk';
import {LogLevel} from '../logger.js';
import {Transformation} from '../transformation.js';
@@ -31,7 +33,8 @@ export class Colorize implements Transformation {
* @param logLevelToColor Map from log level to color transformation to apply
*/
constructor(
private readonly logLevelToColor: {[k in LogLevel]: chalk.Chalk} = {
// not entirely sure why we can't just use the functions directly here
private readonly logLevelToColor: {[k in LogLevel]: ChalkInstance} = {
ERROR: chalk.bold.red,
INFO: chalk.cyan,
LOG: chalk.white,