test: coverage

This commit is contained in:
coderaiser 2026-07-16 15:29:08 +00:00
parent e4ff4a78cc
commit 943bdecd3e
6 changed files with 271 additions and 5 deletions

View file

@ -32,3 +32,34 @@ test('distribute: log: config', (t) => {
}, {
checkAssertionsCount: false,
});
test('distribute: log: stringToRGB', (t) => {
const result = log.stringToRGB('abc');
t.deepEqual(result, [97, 3, 294], 'should return [charCode, length, crc]');
t.end();
});
test('distribute: log: makeColor', (t) => {
const result = log.makeColor('hello');
t.ok(result.includes('hello'), 'should return colored string containing the input');
t.end();
});
test('distribute: log: getDescription', (t) => {
const message = 'some error';
const result = log.getDescription({
message,
});
t.equal(result, message, 'should return message from error object');
t.end();
});
test('distribute: log: connectedStr', (t) => {
t.ok(log.connectedStr, 'should have connectedStr');
t.end();
});

View file

@ -54,3 +54,17 @@ test('cloudcmd: server: env: bool: number: 0', (t) => {
t.notOk(result);
t.end();
});
test('cloudcmd: server: env: bool: zero uppercase', (t) => {
const {CLOUDCMD_TERMINAL} = process.env;
process.env.CLOUDCMD_TERMINAL = '0';
const result = env.bool('terminal');
process.env.CLOUDCMD_TERMINAL = CLOUDCMD_TERMINAL;
t.notOk(result);
t.end();
});

View file

@ -30,3 +30,22 @@ test('themes: no args', (t) => {
t.match(themes.light, css);
t.end();
});
test('themes: production', (t) => {
const themes = getThemes({
isDev: false,
});
t.ok(themes.dark, 'should have dark theme');
t.end();
});
test('themes: production: light', (t) => {
const themes = getThemes({
isDev: false,
});
t.ok(themes.light, 'should have light theme');
t.end();
});