Show disabled tests as skipped

This commit is contained in:
Glavin Wiechert 2017-06-16 00:33:33 -03:00
parent 5378b0bb97
commit a5a00c893e
1 changed files with 12 additions and 7 deletions

View File

@ -15,7 +15,9 @@ isWindows = process.platform is 'win32' or
process.env.OSTYPE is 'cygwin' or process.env.OSTYPE is 'cygwin' or
process.env.OSTYPE is 'msys' process.env.OSTYPE is 'msys'
unspportedLangs = { unsupportedLangs = {
all: [
]
windows: [ windows: [
"ocaml" "ocaml"
"r" "r"
@ -111,10 +113,12 @@ describe "BeautifyLanguages", ->
langNames = fs.readdirSync(langsDir) langNames = fs.readdirSync(langsDir)
for lang in langNames for lang in langNames
# FIXME: Skip testing ocaml in Windows shouldSkipLang = false
if isWindows and unspportedLangs.windows.indexOf(lang) isnt -1 if unsupportedLangs.all.indexOf(lang) isnt -1
shouldSkipLang = true
if isWindows and unsupportedLangs.windows.indexOf(lang) isnt -1
console.warn("Tests for Windows do not support #{lang}") console.warn("Tests for Windows do not support #{lang}")
continue shouldSkipLang = true
do (lang) -> do (lang) ->
# Generate the path to where al of the tests are # Generate the path to where al of the tests are
@ -136,7 +140,7 @@ describe "BeautifyLanguages", ->
fs.mkdirSync(expectedDir) fs.mkdirSync(expectedDir)
# Language group tests # Language group tests
describe "when beautifying language '#{lang}'", -> describe "#{if shouldSkipLang then '#' else ''}when beautifying language '#{lang}'", ->
# All tests for language # All tests for language
testNames = fs.readdirSync(originalDir) testNames = fs.readdirSync(originalDir)
@ -145,11 +149,12 @@ describe "BeautifyLanguages", ->
ext = path.extname(testFileName) ext = path.extname(testFileName)
testName = path.basename(testFileName, ext) testName = path.basename(testFileName, ext)
# If prefixed with underscore (_) then this is a hidden test # If prefixed with underscore (_) then this is a hidden test
shouldSkip = false
if testFileName[0] is '_' if testFileName[0] is '_'
# Do not show this test # Do not show this test
return shouldSkip = true
# Confirm this is a test # Confirm this is a test
it "#{testName} #{testFileName}", -> it "#{if shouldSkip then '# ' else ''}#{testName} #{testFileName}", ->
# Generate paths to test files # Generate paths to test files
originalTestPath = path.resolve(originalDir, testFileName) originalTestPath = path.resolve(originalDir, testFileName)