From 524f8b206cbba245c78b016f62c8e79f08f776ed Mon Sep 17 00:00:00 2001 From: Brian Olore Date: Sat, 5 Oct 2019 15:44:46 -0400 Subject: [PATCH] fix(RuleFailure): don't force uppercase on ruleSeverity in toJson implementation (#2622) --- src/language/rule/rule.ts | 2 +- test/formatters/jsonFormatterTests.ts | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/language/rule/rule.ts b/src/language/rule/rule.ts index a3380812437..039afeb2d7d 100644 --- a/src/language/rule/rule.ts +++ b/src/language/rule/rule.ts @@ -342,7 +342,7 @@ export class RuleFailure { : this.fix.toJson(), name: this.fileName, ruleName: this.ruleName, - ruleSeverity: this.ruleSeverity.toUpperCase(), + ruleSeverity: this.ruleSeverity, startPosition: this.startPosition.toJson(), }; } diff --git a/test/formatters/jsonFormatterTests.ts b/test/formatters/jsonFormatterTests.ts index b86505ee6c6..c4970118b30 100644 --- a/test/formatters/jsonFormatterTests.ts +++ b/test/formatters/jsonFormatterTests.ts @@ -73,7 +73,7 @@ describe("JSON Formatter", () => { character: 1, }, ruleName: "first-name", - ruleSeverity: "ERROR", + ruleSeverity: "error", }, { name: TEST_FILE, @@ -89,7 +89,7 @@ describe("JSON Formatter", () => { character: 0, }, ruleName: "last-name", - ruleSeverity: "ERROR", + ruleSeverity: "error", }, { name: TEST_FILE, @@ -110,9 +110,10 @@ describe("JSON Formatter", () => { character: 0, }, ruleName: "full-name", - ruleSeverity: "ERROR", + ruleSeverity: "error", }, ]; + /* tslint:enable:object-literal-sort-keys */ const actualResult = JSON.parse(formatter.format(failures));