diff options
author | cdetrio <cdetrio@gmail.com> | 2017-08-06 05:10:03 +0800 |
---|---|---|
committer | Ubuntu <ubuntu@ip-172-31-32-43.us-west-2.compute.internal> | 2017-08-08 04:41:46 +0800 |
commit | 0570119b4075010dfb8b6611523e1d5c26829ccf (patch) | |
tree | 768da47ecb23d08d462981d9b38af8e8b1be5304 /JSONSchema/validate.js | |
parent | 8b3777057118b3157772dbe1fe9fb3404ecbb4c1 (diff) | |
download | tangerine-tests-0570119b4075010dfb8b6611523e1d5c26829ccf.tar tangerine-tests-0570119b4075010dfb8b6611523e1d5c26829ccf.tar.gz tangerine-tests-0570119b4075010dfb8b6611523e1d5c26829ccf.tar.bz2 tangerine-tests-0570119b4075010dfb8b6611523e1d5c26829ccf.tar.lz tangerine-tests-0570119b4075010dfb8b6611523e1d5c26829ccf.tar.xz tangerine-tests-0570119b4075010dfb8b6611523e1d5c26829ccf.tar.zst tangerine-tests-0570119b4075010dfb8b6611523e1d5c26829ccf.zip |
validate.js takes schema file as argument
Diffstat (limited to 'JSONSchema/validate.js')
-rwxr-xr-x | JSONSchema/validate.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/JSONSchema/validate.js b/JSONSchema/validate.js index fa46ac39c..1a1a605db 100755 --- a/JSONSchema/validate.js +++ b/JSONSchema/validate.js @@ -4,6 +4,7 @@ var fs = require('fs'); var validate = require('jsonschema').validate; var readline = require('readline'); +var schemaFile = process.argv[2]; var schema = ''; var testCode = ''; var success = true; @@ -23,7 +24,7 @@ rl.on('line', function(line) { }); rl.on('close', function() { - schema = JSON.parse(fs.readFileSync('JSONSchema/schema.json')); + schema = JSON.parse(fs.readFileSync(schemaFile)); //sort file names alphabetically so that log output ordering is consistent fileNames.sort(function(a,b) { @@ -40,6 +41,7 @@ rl.on('close', function() { try { testCode = JSON.parse(fs.readFileSync(fileNames[i])); } catch(e) { + console.log('error on file:', fileNames[i]) console.log(e); numFailed++; } |