From 7f28803a82e12e9721c3046dc9d71b4d825f8dd4 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Thu, 16 Jul 2026 15:31:22 +0000 Subject: [PATCH] =?UTF-8?q?chore:=20cloudcmd:=20actions:=20lint=20?= =?UTF-8?q?=E2=98=98=EF=B8=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/dom/dom-tree.spec.js | 29 ++++++++++++++++------- client/modules/config/input.spec.js | 36 +++++++++++++++++++++++------ server/distribute/log.spec.js | 4 +--- server/env.spec.js | 1 - server/themes.spec.js | 1 - 5 files changed, 51 insertions(+), 20 deletions(-) diff --git a/client/dom/dom-tree.spec.js b/client/dom/dom-tree.spec.js index 64a28b29..53b376c7 100644 --- a/client/dom/dom-tree.spec.js +++ b/client/dom/dom-tree.spec.js @@ -50,7 +50,9 @@ test('dom: isContainClass: contains: array', (t) => { test('dom: getByTag', (t) => { const getElementsByTagName = stub(); - const element = {getElementsByTagName}; + const element = { + getElementsByTagName, + }; getByTag('div', element); @@ -60,7 +62,9 @@ test('dom: getByTag', (t) => { test('dom: getById', (t) => { const querySelector = stub(); - const element = {querySelector}; + const element = { + querySelector, + }; getById('my-id', element); @@ -70,7 +74,9 @@ test('dom: getById', (t) => { test('dom: getByClassAll', (t) => { const getElementsByClassName = stub(); - const element = {getElementsByClassName}; + const element = { + getElementsByClassName, + }; getByClassAll('my-class', element); @@ -91,7 +97,9 @@ test('dom: getByClass: calls getByClassAll', (t) => { test('dom: getByDataName', (t) => { const querySelector = stub(); - const element = {querySelector}; + const element = { + querySelector, + }; getByDataName('hello', element); @@ -102,7 +110,9 @@ test('dom: getByDataName', (t) => { test('dom: hide', (t) => { const add = stub(); const element = { - classList: {add}, + classList: { + add, + }, }; hide(element); @@ -114,7 +124,9 @@ test('dom: hide', (t) => { test('dom: show', (t) => { const remove = stub(); const element = { - classList: {remove}, + classList: { + remove, + }, }; show(element); @@ -127,7 +139,9 @@ test('dom: getByClassAll: without element uses document', (t) => { const getElementsByClassName = stub(); const prevDocument = globalThis.document; - globalThis.document = {getElementsByClassName}; + globalThis.document = { + getElementsByClassName, + }; getByClassAll('my-class'); @@ -136,4 +150,3 @@ test('dom: getByClassAll: without element uses document', (t) => { t.calledWith(getElementsByClassName, ['my-class'], 'should fallback to document when no element'); t.end(); }); - diff --git a/client/modules/config/input.spec.js b/client/modules/config/input.spec.js index a2ddcda2..9d0866cd 100644 --- a/client/modules/config/input.spec.js +++ b/client/modules/config/input.spec.js @@ -1,5 +1,10 @@ import {test, stub} from 'supertape'; -import {convert, getName, getValue, setValue} from './input.js'; +import { + convert, + getName, + getValue, + setValue, +} from './input.js'; test('cloudcmd: client: config: input: convert', (t) => { const result = convert({ @@ -42,7 +47,9 @@ test('cloudcmd: client: config: input: convert: bool false', (t) => { test('cloudcmd: client: config: input: getName', (t) => { const getAttribute = stub().returns('js-hello'); - const element = {getAttribute}; + const element = { + getAttribute, + }; const result = getName(element); @@ -55,7 +62,10 @@ test('cloudcmd: client: config: input: getValue: checkbox', (t) => { type: 'checkbox', checked: true, }); - const element = {querySelector}; + + const element = { + querySelector, + }; const result = getValue('auth', element); @@ -68,7 +78,10 @@ test('cloudcmd: client: config: input: getValue: number', (t) => { type: 'number', value: '42', }); - const element = {querySelector}; + + const element = { + querySelector, + }; const result = getValue('port', element); @@ -81,7 +94,10 @@ test('cloudcmd: client: config: input: getValue: default', (t) => { type: 'text', value: 'hello', }); - const element = {querySelector}; + + const element = { + querySelector, + }; const result = getValue('name', element); @@ -94,8 +110,11 @@ test('cloudcmd: client: config: input: setValue: checkbox', (t) => { type: 'checkbox', checked: false, }; + const querySelector = stub().returns(el); - const element = {querySelector}; + const element = { + querySelector, + }; setValue('auth', true, element); @@ -108,8 +127,11 @@ test('cloudcmd: client: config: input: setValue: default', (t) => { type: 'text', value: 'old', }; + const querySelector = stub().returns(el); - const element = {querySelector}; + const element = { + querySelector, + }; setValue('name', 'new', element); diff --git a/server/distribute/log.spec.js b/server/distribute/log.spec.js index a3b03f68..1c6d1aa3 100644 --- a/server/distribute/log.spec.js +++ b/server/distribute/log.spec.js @@ -33,7 +33,6 @@ test('distribute: log: config', (t) => { checkAssertionsCount: false, }); - test('distribute: log: stringToRGB', (t) => { const result = log.stringToRGB('abc'); @@ -44,11 +43,10 @@ test('distribute: log: stringToRGB', (t) => { test('distribute: log: makeColor', (t) => { const result = log.makeColor('hello'); - t.ok(result.includes('hello'), 'should return colored string containing the input'); + t.match(result, 'hello', 'should return colored string containing the input'); t.end(); }); - test('distribute: log: getDescription', (t) => { const message = 'some error'; const result = log.getDescription({ diff --git a/server/env.spec.js b/server/env.spec.js index 760e7739..5a8765f4 100644 --- a/server/env.spec.js +++ b/server/env.spec.js @@ -67,4 +67,3 @@ test('cloudcmd: server: env: bool: zero uppercase', (t) => { t.notOk(result); t.end(); }); - diff --git a/server/themes.spec.js b/server/themes.spec.js index 8d761a3c..709896e8 100644 --- a/server/themes.spec.js +++ b/server/themes.spec.js @@ -48,4 +48,3 @@ test('themes: production: light', (t) => { t.ok(themes.light, 'should have light theme'); t.end(); }); -