Skip to content
Permalink
Browse files

Fix: Restore hint status in formatter-html

  • Loading branch information
sarvaje committed Dec 4, 2019
1 parent 4a93a1b commit 51c16daf6c48a45c7e44559a2abdbaeb6e54797c
Showing with 6 additions and 3 deletions.
  1. +6 −3 packages/formatter-html/src/result.ts
@@ -31,6 +31,8 @@ type ThirdPartyInfo = {
* Represents information about a Hint.
*/
export class HintResult {
/** Status of hint. */
public status: string;
/** Number of suggestions reported for this hint. */
public count: number;
/** Suggestions reported for this hint. */
@@ -42,12 +44,13 @@ export class HintResult {
/** Indicate if there is documentation for this hint. */
public hasDoc: boolean;

public constructor(name: string, url: string, isScanner: boolean) {
public constructor(name: string, status: string, url: string, isScanner: boolean) {
const baseName = name.split('/')[0];

this.problems = [];

this.name = name;
this.status = status;
this.count = 0;

// Use `baseName` so multi-hints like `axe/aria` map to `axe`.
@@ -150,7 +153,7 @@ export class CategoryResult {
return hint;
}

hint = new HintResult(name, this.url, this.isScanner);
hint = new HintResult(name, status, this.url, this.isScanner);

if (status === 'pass') {
this.passed.push(hint);
@@ -171,7 +174,7 @@ export class CategoryResult {
let hint = this.getHintByName(hintId);

if (!hint) {
hint = new HintResult(hintId, this.url, this.isScanner);
hint = new HintResult(hintId, Severity[problem.severity].toString(), this.url, this.isScanner);

this.hints.push(hint);
}

0 comments on commit 51c16da

Please sign in to comment.
You can’t perform that action at this time.