MCPcopy Create free account
hub / github.com/error311/FileRise / normalizeTestChecks

Function normalizeTestChecks

public/js/adminPanel.js:1861–1872  ·  view source on GitHub ↗
(checks)

Source from the content-addressed store, hash-verified

1859 (value === 'ok' || value === 'fail' || value === 'skipped' || value === 'unknown') ? value : 'unknown';
1860
1861 const normalizeTestChecks = (checks) => {
1862 if (!Array.isArray(checks)) return [];
1863 return checks
1864 .filter((check) => check && typeof check === 'object')
1865 .map((check) => ({
1866 key: String(check.key || '').trim(),
1867 label: String(check.label || check.key || '').trim(),
1868 state: normalizeCheckState(check.state),
1869 message: String(check.message || '').trim(),
1870 }))
1871 .filter((check) => check.key !== '');
1872 };
1873
1874 const truncateTestMessage = (msg, max = 80) => {
1875 const clean = String(msg || '').replace(/\s+/g, ' ').trim();

Callers 3

getTestStatusFunction · 0.85
runSourceTestFunction · 0.85
initSourcesSectionFunction · 0.85

Calls 1

normalizeCheckStateFunction · 0.85

Tested by

no test coverage detected