Files
klz-cables.com/.pnpm-store/v10/files/7a/2588441575b9cfa5a80b272077796a53b982ac2d4df7c7ff4e7da63fd1dbc22d4f89c4f89b039edb1a337e1971c8caeef51e175158a0cad4486dcc2ea015dc
Marc Mintel 5397309103
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
fix(products): fix breadcrumbs and product filtering (backport from main)
2026-02-24 16:04:21 +01:00

46 lines
1.2 KiB
Plaintext

'use strict'
const { test } = require('node:test')
const match = require('@jsumners/assert-match')
const handleCustomLevelsNamesOpts = require('./handle-custom-levels-names-opts')
test('returns a empty object `{}` for undefined parameter', t => {
const handledCustomLevelNames = handleCustomLevelsNamesOpts()
t.assert.deepStrictEqual(handledCustomLevelNames, {})
})
test('returns a empty object `{}` for unknown parameter', t => {
const handledCustomLevelNames = handleCustomLevelsNamesOpts(123)
t.assert.deepStrictEqual(handledCustomLevelNames, {})
})
test('returns a filled object for string parameter', t => {
const handledCustomLevelNames = handleCustomLevelsNamesOpts('ok:10,warn:20,error:35')
match(handledCustomLevelNames, {
ok: 10,
warn: 20,
error: 35
}, t)
})
test('returns a filled object for object parameter', t => {
const handledCustomLevelNames = handleCustomLevelsNamesOpts({
ok: 10,
warn: 20,
error: 35
})
match(handledCustomLevelNames, {
ok: 10,
warn: 20,
error: 35
}, t)
})
test('defaults missing level num to first index', t => {
const result = handleCustomLevelsNamesOpts('ok:10,info')
match(result, {
ok: 10,
info: 1
}, t)
})