diff --git a/index.js b/index.js index 7e2ac4e..451a6d9 100644 --- a/index.js +++ b/index.js @@ -16,8 +16,8 @@ }; business.doTheJob = function (docObject, cb) { - const dateBegin = docObject.halHarvestModifiedDateFrom; - const dateEnd = docObject.halHarvestModifiedDateTo; + const dateBegin = docObject.harvestModifiedDateFrom; + const dateEnd = docObject.harvestModifiedDateTo; if (!process.env.CORPUSES_ROOT) { const err = { diff --git a/test/run.js b/test/run.js index 39db83e..ac369e2 100644 --- a/test/run.js +++ b/test/run.js @@ -12,8 +12,8 @@ corpusName: 'hal', cartoType: 'conditor:hal', corpusResources: '/applis/corhal/loadistex/corpus-resources', - halHarvestModifiedDateFrom: '2021-11-21T00:00:00.000Z', - halHarvestModifiedDateTo: '2021-11-21T06:00:00.000Z', + harvestModifiedDateFrom: '2021-11-21T00:00:00.000Z', + harvestModifiedDateTo: '2021-11-21T06:00:00.000Z', corpusOutput: '/applis/corhal/corpusOutput' }; } @@ -46,8 +46,8 @@ this.timeout(600000); it('Si le corpusRoot exist déjà', function (done) { const docObject = initDocObject(); - docObject.halHarvestModifiedDateFrom = '2021-10-20T00:00:00.000Z'; - docObject.halHarvestModifiedDateTo = '2021-10-21T00:00:00.000Z'; + docObject.harvestModifiedDateFrom = '2021-10-20T00:00:00.000Z'; + docObject.harvestModifiedDateTo = '2021-10-21T00:00:00.000Z'; const harvestPath = path.join(process.env.CORPUSES_ROOT, 'hal', 'hal-20211020-to-20211021'); fs.mkdirSync(harvestPath, { recursive: true }); business.doTheJob(docObject, function (err) { @@ -60,8 +60,8 @@ it('Si l\'API renvoie une erreur', function (done) { const docObject = initDocObject(); - docObject.halHarvestModifiedDateFrom = '1020-10-20T00:00:00.000Z'; - docObject.halHarvestModifiedDateTo = '1020-10-21T00:00:00.000Z'; + docObject.harvestModifiedDateFrom = '1020-10-20T00:00:00.000Z'; + docObject.harvestModifiedDateTo = '1020-10-21T00:00:00.000Z'; // message d'erreur de l'api business.doTheJob(docObject, function (err) { expect(err.code).to.equal('FetchError'); @@ -71,8 +71,8 @@ it('Si aucun résultat trouvé', function (done) { const docObject = initDocObject(); - docObject.halHarvestModifiedDateFrom = '2050-10-20T00:00:00.000Z'; - docObject.halHarvestModifiedDateTo = '2050-10-21T00:00:00.000Z'; + docObject.harvestModifiedDateFrom = '2050-10-20T00:00:00.000Z'; + docObject.harvestModifiedDateTo = '2050-10-21T00:00:00.000Z'; business.doTheJob(docObject, function (err) { // no result found expect(err.code).to.equal('NoResultFound');