diff options
-rwxr-xr-x | JSONSchema/validate.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/JSONSchema/validate.js b/JSONSchema/validate.js index 4c63500d0..1c176e2a8 100755 --- a/JSONSchema/validate.js +++ b/JSONSchema/validate.js @@ -25,6 +25,17 @@ rl.on('line', function(line) { rl.on('close', function() { schema = JSON.parse(fs.readFileSync('JSONSchema/schema.json')); + //sort file names alphabetically so that log output ordering is consistent + fileNames.sort((a,b) => { + if(a<b) { + return -1; + } else { + return 1; + } + + return 0; + }); + for (var i = 0; i < fileNames.length; i++) { try { testCode = JSON.parse(fs.readFileSync(fileNames[i])); |