diff --git a/tests/bin/test.sh b/tests/bin/test.sh index c4a535d..9bd1284 100755 --- a/tests/bin/test.sh +++ b/tests/bin/test.sh @@ -10,13 +10,18 @@ function validate_schema() { local base=${file//schemas\//} # https://github.com/ajv-validator/ajv-cli/issues/172 - local schemas=$(find schemas -type f -name "*.json" | grep -v "$file") - local rflag="${schemas//$'\n'/ -r }" + local rflags="$(find schemas/ -type f -name "*.json" -not -path "$file" -printf ' -r %p')" local filename=${base/.json/} ls tests/data/$filename/*.json > /dev/null - ./node_modules/.bin/ajv validate --spec=draft2019 --strict --strict-schema=false -c ajv-formats -m tests/external-schemas/hyper-schema.json -r schema.json -r $rflag -s "$file" -d "tests/data/$filename/*.json" + ./node_modules/.bin/ajv validate --spec=draft2019 --strict --strict-schema=false \ + -c ajv-formats \ + -m tests/external-schemas/hyper-schema.json \ + -r schema.json \ + $rflags \ + -s "$file" \ + -d "tests/data/$filename/*.json" } # Modify a schema file using a jq transformation and an optional jq condition