Skip to content

Commit

Permalink
fix: Add missing mocks.
Browse files Browse the repository at this point in the history
  • Loading branch information
Artmann committed Sep 4, 2024
1 parent 0343fd8 commit efe3105
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
6 changes: 4 additions & 2 deletions src/example.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ log.debug('User data processed, preparing to save to database.')

console.log('\n')

log.info('User successfully created with ID: 2e814b77-31fa-4b90-9f82-9766507b3a7a.')
log.info(
'User successfully created with ID: 2e814b77-31fa-4b90-9f82-9766507b3a7a.'
)

console.log('\n')

Expand All @@ -30,4 +32,4 @@ log.fatal(
'Critical error - Unable to connect to primary database, application shutting down'
)

console.log('\n\n\n\n')
console.log('\n\n\n\n')
5 changes: 2 additions & 3 deletions src/logger.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ import { Logger } from './logger'

vi.mock('chalk', async () => ({
default: {
hex: () => {
return (text: string) => text
}
dim: (text: string) => text,
hex: () => (text: string) => text
}
}))

Expand Down
6 changes: 4 additions & 2 deletions src/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export enum Colors {
PastelBlue = '#ABDEE6',
PastelGreen = '#97C1A9',
PastelYellow = '#FDFD96',
PastelRed = '#FF6961',
PastelRed = '#FF6961'
}

const logLevelToColor: Record<LogLevel, string> = {
Expand Down Expand Up @@ -83,7 +83,9 @@ export class Logger {
const logLevel = chalk.hex(logLevelColor)(logLevelName.toUpperCase())
const formattedLogLevel = `[${logLevel}]`

const formattedMessage = [formattedLogLevel, formattedDate, message].join(' ')
const formattedMessage = [formattedLogLevel, formattedDate, message].join(
' '
)

return formattedMessage
}
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
// "outDir": "./dist" /* Specify an output folder for all emitted files. */,
// "removeComments": true, /* Disable emitting comments. */
"noEmit": true, /* Disable emitting files from a compilation. */
"noEmit": true /* Disable emitting files from a compilation. */,
// "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
// "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
// "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */
Expand Down

0 comments on commit efe3105

Please sign in to comment.