Skip to content

Commit

Permalink
feat: add broken-backlinks audit type (SITES-18417) (#86)
Browse files Browse the repository at this point in the history
Add the broken-backlinks as supported audit type for SITES-18417
  • Loading branch information
iuliag authored Jan 18, 2024
1 parent c6ef113 commit b16c366
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
10 changes: 5 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion packages/spacecat-shared-data-access/src/models/audit.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@
import { hasText, isIsoDate, isObject } from '@adobe/spacecat-shared-utils';
import { Base } from './base.js';

export const AUDIT_TYPE_BROKEN_BACKLINKS = 'broken-backlinks';
export const AUDIT_TYPE_CWV = 'cwv';
export const AUDIT_TYPE_LHS_DESKTOP = 'lhs-desktop';
export const AUDIT_TYPE_LHS_MOBILE = 'lhs-mobile';

const EXPIRES_IN_DAYS = 30;

const AUDIT_TYPE_PROPERTIES = {
[AUDIT_TYPE_BROKEN_BACKLINKS]: [],
[AUDIT_TYPE_CWV]: [],
[AUDIT_TYPE_LHS_DESKTOP]: ['performance', 'seo', 'accessibility', 'best-practices'],
[AUDIT_TYPE_LHS_MOBILE]: ['performance', 'seo', 'accessibility', 'best-practices'],
Expand All @@ -36,7 +38,7 @@ const validateScores = (auditResult, auditType) => {
return true;
}

if (!isObject(auditResult.scores)) {
if (auditType !== AUDIT_TYPE_BROKEN_BACKLINKS && !isObject(auditResult.scores)) {
throw new Error(`Missing scores property for audit type '${auditType}'`);
}

Expand Down

0 comments on commit b16c366

Please sign in to comment.