Created
October 29, 2018 09:22
-
-
Save kahunacohen/8dc17c549c65f22284bfd7dce6164560 to your computer and use it in GitHub Desktop.
NCBI-written audit to test for meta with name="ncbi_app"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
const Audit = require("lighthouse").Audit; | |
class NCBIAppAudit extends Audit { | |
static get meta() { | |
return { | |
id: "ncbi_app-audit", | |
title: 'meta name="ncbi_app" is set', | |
failureTitle: 'No meta name="ncbi_app" is set', | |
description: | |
'<meta name="ncbi_app" must be set to properly ping to applog', | |
// The name of the custom gatherer class that provides input to this audit. | |
requiredArtifacts: ["NCBIAppMeta"] | |
}; | |
} | |
static audit(artifacts) { | |
const ret = artifacts.NCBIAppMeta; | |
const score = ret.name && ret.content; | |
return { | |
rawValue: score, | |
score: Number(score) | |
}; | |
} | |
} | |
module.exports = NCBIAppAudit; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
so here it might look like
const score = ret.content && ret.content.length > 3