Skip to content

🎥 Make videos programmatically with React

Update old-version.test.ts

Jonny Burger4556f3d23ceb
diff --git a/packages/lambda/src/test/integration/renders/old-version.test.ts b/packages/lambda/src/test/integration/renders/old-version.test.ts
index a0aea58d64..2b127bc612 100644
--- a/packages/lambda/src/test/integration/renders/old-version.test.ts
+++ b/packages/lambda/src/test/integration/renders/old-version.test.ts
@@ -2,7 +2,6 @@ import {RenderInternals} from '@remotion/renderer';
import {VERSION} from 'remotion/version';
import {LambdaRoutines} from '../../../defaults';
import {handler} from '../../../functions';
-import type {LambdaReturnValues} from '../../../shared/return-values';
import {disableLogs, enableLogs} from '../../disable-logs';
jest.setTimeout(90000);
@@ -12,8 +11,6 @@ const extraContext = {
getRemainingTimeInMillis: () => 12000,
};
-type Await<T> = T extends PromiseLike<infer U> ? U : T;
-
beforeAll(() => {
disableLogs();
});
@@ -27,52 +24,40 @@ afterAll(async () => {
test('Should fail when using an incompatible version', async () => {
process.env.AWS_LAMBDA_FUNCTION_MEMORY_SIZE = '2048';
- const res = await handler(
- {
- type: LambdaRoutines.start,
- serveUrl: 'https://competent-mccarthy-56f7c9.netlify.app/',
- chromiumOptions: {},
- codec: 'h264',
- composition: 'react-svg',
- crf: 9,
- envVariables: {},
- frameRange: [0, 12],
- framesPerLambda: 8,
- imageFormat: 'png',
- inputProps: {},
- logLevel: 'warn',
- maxRetries: 3,
- outName: null,
- pixelFormat: 'yuv420p',
- privacy: 'public',
- proResProfile: undefined,
- quality: undefined,
- scale: 1,
- timeoutInMilliseconds: 12000,
- numberOfGifLoops: null,
- everyNthFrame: 1,
- concurrencyPerLambda: 1,
- downloadBehavior: {
- type: 'play-in-browser',
+ expect(() =>
+ handler(
+ {
+ type: LambdaRoutines.start,
+ serveUrl: 'https://competent-mccarthy-56f7c9.netlify.app/',
+ chromiumOptions: {},
+ codec: 'h264',
+ composition: 'react-svg',
+ crf: 9,
+ envVariables: {},
+ frameRange: [0, 12],
+ framesPerLambda: 8,
+ imageFormat: 'png',
+ inputProps: {},
+ logLevel: 'warn',
+ maxRetries: 3,
+ outName: null,
+ pixelFormat: 'yuv420p',
+ privacy: 'public',
+ proResProfile: undefined,
+ quality: undefined,
+ scale: 1,
+ timeoutInMilliseconds: 12000,
+ numberOfGifLoops: null,
+ everyNthFrame: 1,
+ concurrencyPerLambda: 1,
+ downloadBehavior: {
+ type: 'play-in-browser',
+ },
+ muted: false,
+ version: VERSION,
+ overwrite: true,
},
- muted: false,
- version: VERSION,
- overwrite: true,
- },
- extraContext
- );
- const startRes = res as Await<LambdaReturnValues[LambdaRoutines.start]>;
-
- const progress = (await handler(
- {
- type: LambdaRoutines.status,
- bucketName: startRes.bucketName,
- renderId: startRes.renderId,
- version: VERSION,
- },
- extraContext
- )) as Await<LambdaReturnValues[LambdaRoutines.status]>;
- expect(progress.errors[0].stack).toContain(
- 'Incompatible site: When visiting'
- );
+ extraContext
+ )
+ ).rejects.toThrow(/Incompatible site: When visiting/);
});