Add check for when Language or Beautifier is not found in tests

This commit is contained in:
Glavin Wiechert 2015-05-21 16:43:37 -03:00
parent e0ca55f302
commit 4e12ce9c6c
1 changed files with 7 additions and 1 deletions

View File

@ -138,9 +138,15 @@ describe "BeautifyLanguages", ->
completionFun = (text) -> completionFun = (text) ->
# logger.verbose(expectedTestPath, text) if ext is ".less" # logger.verbose(expectedTestPath, text) if ext is ".less"
expect(text instanceof Error).not.toEqual(true, text) expect(text instanceof Error).not.toEqual(true, text)
return beautifyCompleted = true if text instanceof Error
# if text instanceof Error # if text instanceof Error
# return beautifyCompleted = text # text == Error # return beautifyCompleted = text # text == Error
expect(typeof text).toEqual "string"
expect(text).not.toEqual(null, "Language or Beautifier not found")
return beautifyCompleted = true if text is null
expect(typeof text).toEqual("string", "Text: #{text}")
return beautifyCompleted = true if typeof text is "string"
# Check for beautification errors # Check for beautification errors
if text isnt expectedContents if text isnt expectedContents
# console.warn(allOptions, text, expectedContents) # console.warn(allOptions, text, expectedContents)