Beautify all spec/ files to pass linting with Coffeelint
This commit is contained in:
parent
c1f09e4f8b
commit
0df387dac3
|
@ -26,9 +26,9 @@ if [ "$TEST_PACKAGES" != "none" ]; then
|
|||
fi
|
||||
|
||||
if [ -f ./node_modules/.bin/coffeelint ]; then
|
||||
if [ -d ./lib ]; then
|
||||
if [ -d ./src ]; then
|
||||
echo "Linting package..."
|
||||
./node_modules/.bin/coffeelint lib
|
||||
./node_modules/.bin/coffeelint src
|
||||
rc=$?; if [[ $rc != 0 ]]; then exit $rc; fi
|
||||
fi
|
||||
if [ -d ./spec ]; then
|
||||
|
|
|
@ -150,6 +150,6 @@
|
|||
"scripts": {
|
||||
"prepublish": "npm run docs",
|
||||
"docs": "coffee docs/",
|
||||
"lint": "coffeelint src/"
|
||||
"lint": "coffeelint src/ spec/"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -181,22 +181,22 @@ describe "BeautifyLanguages", ->
|
|||
return beautifyCompleted = true if typeof text isnt "string"
|
||||
# Check for beautification errors
|
||||
if text isnt expectedContents
|
||||
# console.warn(allOptions, text, expectedContents)
|
||||
fileName = expectedTestPath
|
||||
oldStr=text
|
||||
newStr=expectedContents
|
||||
oldHeader="beautified"
|
||||
newHeader="expected"
|
||||
diff = JsDiff.createPatch(fileName, oldStr, \
|
||||
newStr, oldHeader, newHeader)
|
||||
# Get options
|
||||
opts = beautifier.getOptionsForLanguage(allOptions, language)
|
||||
# Show error message with debug information
|
||||
expect(text).toEqual(expectedContents, \
|
||||
"Beautifier output does not match expected \
|
||||
output:\n#{diff}\n\n\
|
||||
With options:\n\
|
||||
#{JSON.stringify(opts, undefined, 4)}")
|
||||
# console.warn(allOptions, text, expectedContents)
|
||||
fileName = expectedTestPath
|
||||
oldStr=text
|
||||
newStr=expectedContents
|
||||
oldHeader="beautified"
|
||||
newHeader="expected"
|
||||
diff = JsDiff.createPatch(fileName, oldStr, \
|
||||
newStr, oldHeader, newHeader)
|
||||
# Get options
|
||||
opts = beautifier.getOptionsForLanguage(allOptions, language)
|
||||
# Show error message with debug information
|
||||
expect(text).toEqual(expectedContents, \
|
||||
"Beautifier output does not match expected \
|
||||
output:\n#{diff}\n\n\
|
||||
With options:\n\
|
||||
#{JSON.stringify(opts, undefined, 4)}")
|
||||
# All done!
|
||||
beautifyCompleted = true
|
||||
|
||||
|
|
Loading…
Reference in New Issue