Made running the import outside of job on test env

- Allows to write tests for the importer easier when there is a "subscription" or a "product" present
This commit is contained in:
Naz 2022-10-19 10:10:20 +08:00
parent 9389064ae2
commit 748ef87954
No known key found for this signature in database

View File

@ -282,7 +282,7 @@ module.exports = class MembersCSVImporter {
meta.originalImportSize = job.batches;
if (job.batches <= 500 && !job.metadata.hasStripeData) {
if ((job.batches <= 500 && !job.metadata.hasStripeData) || process.env.NODE_ENV.startsWith('test')) {
const result = await this.perform(job.filePath);
const importLabelModel = result.imported ? await LabelModel.findOne(importLabel) : null;