This repository has been archived by the owner on Mar 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add testing of all json file, linting of main js and gulp as test
- Loading branch information
Showing
8 changed files
with
119 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
language: node_js | ||
node_js: | ||
- "node" | ||
- "6" | ||
- "5" | ||
- "4" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,23 @@ | ||
#!/usr/bin/env node | ||
|
||
var fs = require("fs"); | ||
var filename = process.argv[2]; | ||
var fs = require('fs'); | ||
var file = process.argv[2]; | ||
|
||
if (filename) { | ||
if(file !== undefined && file !== null) { | ||
checkJson(file); | ||
} else { | ||
for(const i of ['events.json', '2015/events.json', '2016/events.json']) { | ||
checkJson(i); | ||
} | ||
process.exit(0); | ||
} | ||
|
||
function checkJson (filename) { | ||
try { | ||
JSON.parse(fs.readFileSync(filename, "utf8")); | ||
console.log("Look good"); | ||
JSON.parse(fs.readFileSync(filename, 'utf8')); | ||
console.log(filename + ' looks good'); | ||
} catch (err) { | ||
console.error(err); | ||
process.exit(1); | ||
} | ||
} else { | ||
console.log("Usage: check-event-json events.json"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-04/schema#", | ||
"type": "array", | ||
"uniqueItems": false, | ||
"items": { | ||
"type": "object", | ||
"properties": { | ||
"day": { | ||
"type": "string", | ||
"minLength": 1 | ||
}, | ||
"description": { | ||
"type": "string", | ||
"minLength": 1 | ||
}, | ||
"events": { | ||
"type": "array", | ||
"uniqueItems": false, | ||
"items": { | ||
"type": "object", | ||
"properties": { | ||
"name": { | ||
"type": "string", | ||
"minLength": 1 | ||
}, | ||
"by": { | ||
"type": "string", | ||
"minLength": 1 | ||
}, | ||
"time": { | ||
"type": "string", | ||
"minLength": 1 | ||
}, | ||
"place": { | ||
"type": "object", | ||
"properties": { | ||
"id": { | ||
"type": "string", | ||
"minLength": 1 | ||
}, | ||
"map": { | ||
"type": "string", | ||
"minLength": 1 | ||
} | ||
}, | ||
"required": [ | ||
"id", | ||
"map" | ||
] | ||
}, | ||
"description": { | ||
"type": "string", | ||
"minLength": 1 | ||
} | ||
}, | ||
"required": [ | ||
"name", | ||
"by", | ||
"time", | ||
"place", | ||
"description" | ||
] | ||
} | ||
} | ||
}, | ||
"required": [ | ||
"day", | ||
"description", | ||
"events" | ||
] | ||
} | ||
} |