Skip to content

🎥 Make videos programmatically with React

throw err if headobject does not exist in mock

Jonny Burger0b6362a06b61
diff --git a/packages/lambda/src/functions/helpers/__mocks__/io.ts b/packages/lambda/src/functions/helpers/__mocks__/io.ts
index 1879293927..e27c318707 100644
--- a/packages/lambda/src/functions/helpers/__mocks__/io.ts
+++ b/packages/lambda/src/functions/helpers/__mocks__/io.ts
@@ -72,8 +72,14 @@ export const lambdaHeadCommand: typeof headOriginal = ({
key,
region,
});
+ if (!read) {
+ const err = new Error('File not found');
+ err.name = 'NotFound';
+ throw err;
+ }
+
return Promise.resolve({
- ContentLength: read?.content.toString().length,
+ ContentLength: read.content.toString().length,
LastModified: new Date(),
});
};