Fix OpenAPI tests being run by JSON & YAML

Tests are run by file extension. The [JSON] and [YAML] tests were running the _bad_ [OPENAPI] tests and expecting them to fail.

For [OPENAPI] the _bad_ tests are syntactically good JSON/YAML but bad OAS.
This commit is contained in:
Justin Kalland 2020-06-25 11:49:09 +02:00
parent eac560b35b
commit 37f6828d1e
6 changed files with 3 additions and 2 deletions

View file

@ -2,7 +2,8 @@
This folder holds the test cases for **OpenAPI**.
## Additional Docs
No Additional information is needed for this test case.
The `_bad_` tests are valid `.yml`/`.json` but invalid OpenAPI specs.
The test extensions used are `.ymlopenapi`/`.jsonopenapi` instead of `.yml`/`.json`. This is to prevent the [YAML] and [JSON] tests from picking them up.
## Good Test Cases
The test cases denoted: `LANGUAGE_good_FILE.EXTENSION` are all valid, and should pass successfully when linted.

View file

@ -2236,7 +2236,7 @@ RunTestCases()
TestCodebase "CSS" "stylelint" "stylelint --config $CSS_LINTER_RULES" ".*\.\(css\)\$"
TestCodebase "ENV" "dotenv-linter" "dotenv-linter" ".*\.\(env\)\$"
TestCodebase "KOTLIN" "ktlint" "ktlint" ".*\.\(kt\|kts\)\$"
TestCodebase "OPENAPI" "spectral" "spectral lint -r $OPENAPI_LINTER_RULES" ".*\.\(yml\|yaml\|json\)\$"
TestCodebase "OPENAPI" "spectral" "spectral lint -r $OPENAPI_LINTER_RULES" ".*\.\(ymlopenapi\|jsonopenapi\)\$"
#################
# Footer prints #