-
Notifications
You must be signed in to change notification settings - Fork 120
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
93 additions
and
25 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 |
---|---|---|
@@ -1,3 +1,31 @@ | ||
|
||
npm link | ||
validator | ||
## Introduction | ||
This project is made to validate any json response with all releases. | ||
|
||
The command line interface is called "validator". Use it to download releases, | ||
|
||
and then run json on the releases. Check out the Makefile to get started. | ||
|
||
You can also use the scripts/all-releases.sh to run the validator on every release. | ||
|
||
## Getting started | ||
cd validator | ||
npm install | ||
|
||
## Examples | ||
### Download and test a release | ||
validator download 5.6.0 | ||
|
||
sh scripts/all-releases.sh ../services-directions-models/src/test/resources/directions_* | ||
|
||
### Download all releases and test a json | ||
validator download-all | ||
|
||
sh scripts/all-releases.sh json/tokyo-2020-09-22.json | ||
|
||
### Explore the releases | ||
- validator list-services | ||
- validator list-releases | ||
- validator list-releases mapbox-sdk-geojson | ||
- validator list-releases mapbox-sdk-directions-models | ||
- rm -rf releases |
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,30 @@ | ||
const download = require('../src/download') | ||
|
||
const chai = require('chai'); | ||
const assert = chai.assert | ||
const should = chai.should(); | ||
|
||
describe('#downloadRelease()', function() { | ||
context('should successfully download a release', function() { | ||
|
||
it('should download results for 4 services', async function () { | ||
const services = await download.downloadRelease('5.5.0') | ||
|
||
services.should.be.an('array').to.have.lengthOf(4) | ||
}); | ||
|
||
it('should return success for each result', async function() { | ||
const services = await download.downloadRelease('5.5.0') | ||
|
||
const success = services.every(value => value.result == "success") | ||
|
||
assert.isTrue(success, `expecting result values to be 'retry' ${JSON.stringify(services)}`) | ||
}); | ||
}) | ||
}); | ||
|
||
|
||
// "https://dl.bintray.com/mapbox/mapbox/com/mapbox/mapboxsdk/mapbox-sdk-services/5.4.0/mapbox-sdk-services-5.4.0.jar", | ||
// "https://dl.bintray.com/mapbox/mapbox/com/mapbox/mapboxsdk/mapbox-sdk-geojson/5.4.0/mapbox-sdk-geojson-5.4.0.jar", | ||
// "https://dl.bintray.com/mapbox/mapbox/com/mapbox/mapboxsdk/mapbox-sdk-directions-models/5.4.0/mapbox-sdk-directions-models-5.4.0.jar", | ||
// "https://dl.bintray.com/mapbox/mapbox/com/mapbox/mapboxsdk/mapbox-sdk-directions-refresh-models/5.4.0/mapbox-sdk-directions-refresh-models-5.4.0.jar" |