Skip to content

🎥 Make videos programmatically with React

get current architecture

Jonny Burgerb9f9e4f2bade
diff --git a/packages/lambda/src/api/__mocks__/create-function.ts b/packages/lambda/src/api/__mocks__/create-function.ts
index 66f6906764..9201f10440 100644
--- a/packages/lambda/src/api/__mocks__/create-function.ts
+++ b/packages/lambda/src/api/__mocks__/create-function.ts
@@ -1,4 +1,8 @@
-import {CURRENT_VERSION, DEFAULT_MEMORY_SIZE} from '../../defaults';
+import {
+ CURRENT_VERSION,
+ DEFAULT_EPHEMERAL_STORAGE_IN_MB,
+ DEFAULT_MEMORY_SIZE,
+} from '../../defaults';
import {createFunction as original} from '../create-function';
import {addFunction} from '../mock-functions';
@@ -10,6 +14,7 @@ export const createFunction: typeof original = async (input) => {
memorySizeInMb: DEFAULT_MEMORY_SIZE,
timeoutInSeconds: input.timeoutInSeconds,
version: CURRENT_VERSION,
+ diskSizeInMb: DEFAULT_EPHEMERAL_STORAGE_IN_MB,
},
input.region
);
diff --git a/packages/lambda/src/functions/helpers/__mocks__/get-current-architecture.ts b/packages/lambda/src/functions/helpers/__mocks__/get-current-architecture.ts
new file mode 100644
index 0000000000..f61d5b9d2e
--- /dev/null
+++ b/packages/lambda/src/functions/helpers/__mocks__/get-current-architecture.ts
@@ -0,0 +1,5 @@
+import {getCurrentArchitecture as original} from '../get-current-architecture';
+
+export const getCurrentArchitecture: typeof original = () => {
+ return 'arm64';
+};
diff --git a/packages/lambda/src/functions/helpers/get-current-architecture.ts b/packages/lambda/src/functions/helpers/get-current-architecture.ts
index 8be3bfe2a9..507dee08c9 100644
--- a/packages/lambda/src/functions/helpers/get-current-architecture.ts
+++ b/packages/lambda/src/functions/helpers/get-current-architecture.ts
@@ -4,8 +4,9 @@ import {LambdaArchitecture} from '../../shared/validate-architecture';
export const getCurrentArchitecture = (): LambdaArchitecture => {
if (!isInsideLambda()) {
throw new Error(
- 'Should not call getCurrentRegion() if not inside a lambda function'
+ 'Should not call getCurrentArchitecture() if not inside a lambda function'
);
}
+
return process.arch.includes('arm') ? 'arm64' : 'x86_64';
};
diff --git a/packages/lambda/src/test/setup.ts b/packages/lambda/src/test/setup.ts
index 03695ae14f..782e6e5bb8 100644
--- a/packages/lambda/src/test/setup.ts
+++ b/packages/lambda/src/test/setup.ts
@@ -16,6 +16,9 @@ jest.mock('../functions/helpers/print-cloudwatch-helper', () =>
jest.mock('../functions/helpers/get-current-region', () =>
jest.requireActual('../functions/helpers/__mocks__/get-current-region')
);
+jest.mock('../functions/helpers/get-current-architecture', () =>
+ jest.requireActual('../functions/helpers/__mocks__/get-current-architecture')
+);
jest.mock('../functions/helpers/get-browser-instance', () =>
jest.requireActual('../functions/helpers/__mocks__/get-browser-instance')
);