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
////Constants ////////////////////////////////////////////// | |
function jsonOk (body) { | |
var mockResponse = new window.Response(JSON.stringify(body), { //the fetch API returns a resolved window Response object | |
status: 200, | |
headers: { | |
'Content-type': 'application/json' | |
} | |
}); |
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
FILES_PATTERN='\.(js|coffee)(\..+)?$' | |
FORBIDDEN='console.log' | |
git diff --cached --name-only | grep -E $FILES_PATTERN | GREP_COLOR='4;5;37;41' xargs grep --color --with-filename -n $FORBIDDEN && echo 'COMMIT REJECTED Found "console.log" references in your javascript. Please remove them before commiting'; | |
# my zsh does annoying things with ! | |
[ $? -ne 0 ] |