Skip to content

Commit 09b5646

Browse files
Iss1019feat (#1030)
* [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>
1 parent 6ed6260 commit 09b5646

File tree

14 files changed

+400
-123
lines changed

14 files changed

+400
-123
lines changed

associateTests.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ const v3CovidTests = [
1414
'tests/v3/covid-19/api_nyt.spec.js',
1515
'tests/v3/covid-19/api_therapeutics.spec.js',
1616
'tests/v3/covid-19/api_vaccine.spec.js',
17-
'tests/v3/covid-19/api_worldometers.spec.js'
17+
'tests/v3/covid-19/api_worldometers.spec.js',
18+
'tests/v3/covid-19/api_variants.spec.js'
1819
];
1920

2021
// Influenza tests are broken
@@ -41,6 +42,7 @@ const fileNameToTestMap = {
4142
'apiWorldometers.js': ['tests/v2/api_worldometers.spec.js', 'tests/v3/covid-19/api_worldometers.spec.js'],
4243
'apiTherapeutics.js': ['tests/v3/covid-19/api_therapeutics.spec.js'],
4344
'apiVaccine.js': ['tests/v3/covid-19/api_vaccine.spec.js'],
45+
'apiVariants.js': ['tests/v3/covid-19/api_variants.spec.js'],
4446
'instances.js': allTests,
4547
'appleMobilityData.js': ['tests/v2/api_apple.spec.js', 'tests/v3/covid-19/api_apple.spec.js'],
4648
'getVaccine.js': ['tests/v3/covid-19/api_vaccine.spec.js'],

config/config.keys.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"vaccine_coverage": "covidapi:vaccine_coverage",
2020
"vaccine_state_coverage": "covidapi:vaccine_state_coverage",
2121
"therapeutics": "covidapi:therapeutics",
22+
"variants":"covidapi:variants",
2223
"influenza_ILINET": "influenza:ILINET",
2324
"influenza_USPHL": "influenza:USPHL",
2425
"influenza_USCL": "influenza:USCL"

config/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ config.therapeuticsInterval = process.env.THERAPEUTICS_INTERVAL || 864e5;
3838
config.ebolaInterval = process.env.EBOLA_INTERVAL || 864e5;
3939
// eslint-disable-next-line camelcase
4040
config.cdcInterval = process.env.CDC_INTERVAL || 864e5;
41+
// eslint-disable-next-line camelcase
42+
config.variantInterval = process.env.VARIANT_INTERVAL || 864e5;
4143

4244
// SENTRY KEY (ONLY FOR PRODUCTION)
4345
// eslint-disable-next-line camelcase

package-lock.json

Lines changed: 61 additions & 112 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
"lint": "eslint '**/*.js'",
2222
"lint:fix": "eslint ./**/*.js --fix",
2323
"lint:win32": "eslint ./**/*.js",
24-
"test": "mocha ./tests --exit --recursive --timeout 200000",
25-
"test-single": "mocha $1 --exit --timeout 200000",
24+
"test": "mocha ./tests --exit --recursive --timeout 300000",
25+
"test-single": "mocha $1 --exit --timeout 300000",
2626
"docker-start": "docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d --build",
2727
"docker-down": "docker-compose -f docker-compose.yml -f docker-compose.prod.yml down --rmi all",
2828
"docker-start-dev": "docker-compose -f docker-compose.yml -f docker-compose.dev.yml up -d --build",

0 commit comments

Comments
 (0)