Skip to content

Commit

Permalink
Made running the import outside of job on test env
Browse files Browse the repository at this point in the history
- Allows to write tests for the importer easier when there is a "subscription" or a "product" present
  • Loading branch information
naz committed Oct 19, 2022
1 parent 9389064 commit 748ef87
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ghost/members-importer/lib/importer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 748ef87

Please sign in to comment.