Skip to content

Commit

Permalink
Iss1019feat (#1030)
Browse files Browse the repository at this point in the history
* [FEAT] create the scraper in the getEuropeVariants.js file, modify the api_gov.spec.js and getGovData.js files

* [FEAT] create the scraper in the getEuropeVariants.js file, modify the api_gov.spec.js and getGovData.js files

* [MODIFY] Rename the getEuropeVariants to --> getVariants

* [MODIFY] Add the line 22 variants to the json

* [MODIFY] change the values of keys.variants in the line 15 and 22

* [ADD/MODIFY] add the instance of the variant.js file and modify the getGovData.js since the variant scraper doesn't belong in there

* [MODIFY] change a several files in order to connect the variant scraper with the endpoint v3/covid-19/variants/countries/{country}

* [MODIFY] now the scraper works and return the data in the correct format

* [MODIFY] remove the parameters yearWeek and variant from router.get in apiVariants.js file since they're never use

* [MODIFY] add test for the getVariants.js scraper and remove console.log and commented code from the others files.

* [MODIFY] add swagger documentation

* [MODIFY] fix swagger documentation

* [MODIFY] fix eslint style problems

* [MODIFY] I commented the lines 2-5 in api_influenza.spec.js file to fix the linting problem, as there are variables assigned that are never used.

* [MODIFY] I change the --timeout value from 200000 to 300000 for the 'test' and the 'test-single' in the package.json file in order to get time enough to complete all  tests

* [MODIFY] Put back the var in line 57 in order to get a right eslint performance

Co-authored-by: Ethan Winters <ebwinters@comcast.net>
  • Loading branch information
yosoycentli and ebwinters authored Feb 19, 2022
1 parent 6ed6260 commit 09b5646
Show file tree
Hide file tree
Showing 14 changed files with 400 additions and 123 deletions.
4 changes: 3 additions & 1 deletion associateTests.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ const v3CovidTests = [
'tests/v3/covid-19/api_nyt.spec.js',
'tests/v3/covid-19/api_therapeutics.spec.js',
'tests/v3/covid-19/api_vaccine.spec.js',
'tests/v3/covid-19/api_worldometers.spec.js'
'tests/v3/covid-19/api_worldometers.spec.js',
'tests/v3/covid-19/api_variants.spec.js'
];

// Influenza tests are broken
Expand All @@ -41,6 +42,7 @@ const fileNameToTestMap = {
'apiWorldometers.js': ['tests/v2/api_worldometers.spec.js', 'tests/v3/covid-19/api_worldometers.spec.js'],
'apiTherapeutics.js': ['tests/v3/covid-19/api_therapeutics.spec.js'],
'apiVaccine.js': ['tests/v3/covid-19/api_vaccine.spec.js'],
'apiVariants.js': ['tests/v3/covid-19/api_variants.spec.js'],
'instances.js': allTests,
'appleMobilityData.js': ['tests/v2/api_apple.spec.js', 'tests/v3/covid-19/api_apple.spec.js'],
'getVaccine.js': ['tests/v3/covid-19/api_vaccine.spec.js'],
Expand Down
1 change: 1 addition & 0 deletions config/config.keys.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"vaccine_coverage": "covidapi:vaccine_coverage",
"vaccine_state_coverage": "covidapi:vaccine_state_coverage",
"therapeutics": "covidapi:therapeutics",
"variants":"covidapi:variants",
"influenza_ILINET": "influenza:ILINET",
"influenza_USPHL": "influenza:USPHL",
"influenza_USCL": "influenza:USCL"
Expand Down
2 changes: 2 additions & 0 deletions config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ config.therapeuticsInterval = process.env.THERAPEUTICS_INTERVAL || 864e5;
config.ebolaInterval = process.env.EBOLA_INTERVAL || 864e5;
// eslint-disable-next-line camelcase
config.cdcInterval = process.env.CDC_INTERVAL || 864e5;
// eslint-disable-next-line camelcase
config.variantInterval = process.env.VARIANT_INTERVAL || 864e5;

// SENTRY KEY (ONLY FOR PRODUCTION)
// eslint-disable-next-line camelcase
Expand Down
173 changes: 61 additions & 112 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
"lint": "eslint '**/*.js'",
"lint:fix": "eslint ./**/*.js --fix",
"lint:win32": "eslint ./**/*.js",
"test": "mocha ./tests --exit --recursive --timeout 200000",
"test-single": "mocha $1 --exit --timeout 200000",
"test": "mocha ./tests --exit --recursive --timeout 300000",
"test-single": "mocha $1 --exit --timeout 300000",
"docker-start": "docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d --build",
"docker-down": "docker-compose -f docker-compose.yml -f docker-compose.prod.yml down --rmi all",
"docker-start-dev": "docker-compose -f docker-compose.yml -f docker-compose.dev.yml up -d --build",
Expand Down
Loading

0 comments on commit 09b5646

Please sign in to comment.