mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-02 17:00:08 +00:00
* update biome to v2 * Run biome check --write * Update biome.jsonc Co-authored-by: Link <lts20050703@gmail.com> * Fix config error * Bump biome version * Update website/yarn.lock * Update biome to 2.1.3 --------- Co-authored-by: Link <lts20050703@gmail.com>
33 lines
816 B
TypeScript
33 lines
816 B
TypeScript
import { expect } from 'chai'
|
|
import { describe, it } from 'mocha'
|
|
import { createLogger, LogLevels } from '../src/logger.js'
|
|
|
|
describe('Logger', () => {
|
|
it('create logger with default options', () => {
|
|
const loggy = createLogger()
|
|
loggy.setLevel(LogLevels.Debug)
|
|
loggy.debug('debugging')
|
|
loggy.error('error')
|
|
loggy.fatal('fatal')
|
|
loggy.info('info')
|
|
loggy.warn('warn')
|
|
|
|
loggy.debug('debugging')
|
|
loggy.error('error')
|
|
loggy.fatal('fatal')
|
|
loggy.info('info')
|
|
loggy.warn('warn')
|
|
})
|
|
|
|
it('create logger with a name', () => {
|
|
const loggy = createLogger({ name: 'loggy' })
|
|
expect(loggy).to.exist
|
|
})
|
|
|
|
it('Handle fake level', () => {
|
|
const loggy = createLogger({ name: 'fake level' })
|
|
const level = 123 as LogLevels
|
|
loggy.log(level, 'idk')
|
|
})
|
|
})
|