-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove server reporting, fixes for poltergeist
- Do not POST to /access_lint/errors. This should be a configuration option eventually. - Log violation message in a format that poltergeist webdriver can handle. - Check deep equality of the violation messages with underscore (JSON.stringify was failing in poltergeist). - Update Readme.
- Loading branch information
Cameron Cundiff
committed
May 22, 2016
1 parent
93d8f3c
commit 3ee87b7
Showing
5 changed files
with
23 additions
and
55 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,20 @@ | ||
import _ from "underscore"; | ||
|
||
export default class Logger { | ||
constructor() { | ||
this.logged = [] | ||
} | ||
|
||
warn(violation) { | ||
if(!this.exists(violation)) { | ||
console.warn(violation); | ||
if(!this.seen(violation)) { | ||
window.console.warn(violation.help, violation.nodes); | ||
this.logged.push(violation); | ||
} | ||
} | ||
|
||
exists(violation) { | ||
let exists = false; | ||
|
||
this.logged.forEach(function(entry) { | ||
if (JSON.stringify(entry) === JSON.stringify(violation)) { | ||
exists = true; | ||
} | ||
seen(violation) { | ||
return _.any(this.logged, function(message) { | ||
return _.isEqual(message, violation) | ||
}); | ||
|
||
return exists; | ||
} | ||
} |
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
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