feat(medusa): Add file size calculation for product export (#1726)

This commit is contained in:
Adrien de Peretti
2022-06-28 15:27:36 +02:00
committed by GitHub
parent c6dc9086cf
commit fb7abbf407
3 changed files with 12 additions and 1 deletions

View File

@@ -133,6 +133,9 @@ describe("Batch job of product-export type", () => {
expect(isFileExists).toBeTruthy()
const fileSize = (await fs.stat(exportFilePath)).size
expect(batchJob.result?.file_size).toBe(fileSize)
const data = (await fs.readFile(exportFilePath)).toString()
const [, ...lines] = data.split("\r\n").filter(l => l)