Skip to content

🎥 Make videos programmatically with React

Update download-file.test.ts

Jonny Burger3f58a114e581
diff --git a/packages/renderer/src/test/download-file.test.ts b/packages/renderer/src/test/download-file.test.ts
index 5f08e1988b..0687d30fc3 100644
--- a/packages/renderer/src/test/download-file.test.ts
+++ b/packages/renderer/src/test/download-file.test.ts
@@ -4,26 +4,30 @@ import {tmpdir} from 'node:os';
import {getSanitizedFilenameForAssetUrl} from '../assets/download-and-map-assets-to-file';
import {downloadFile} from '../assets/download-file';
-test('Should be able to download file', async () => {
- const downloadDir = tmpdir();
- const {to} = await downloadFile({
- url: 'https://remotion.dev/',
- to: (contentDisposition, contentType) => {
- return getSanitizedFilenameForAssetUrl({
- contentDisposition,
- downloadDir,
- src: 'https://remotion.dev/',
- contentType,
- });
- },
- onProgress: () => undefined,
- indent: false,
- logLevel: 'info',
- });
- const data = await fs.promises.readFile(to, 'utf8');
+test(
+ 'Should be able to download file',
+ async () => {
+ const downloadDir = tmpdir();
+ const {to} = await downloadFile({
+ url: 'https://remotion.dev/',
+ to: (contentDisposition, contentType) => {
+ return getSanitizedFilenameForAssetUrl({
+ contentDisposition,
+ downloadDir,
+ src: 'https://remotion.dev/',
+ contentType,
+ });
+ },
+ onProgress: () => undefined,
+ indent: false,
+ logLevel: 'info',
+ });
+ const data = await fs.promises.readFile(to, 'utf8');
- expect(data).toMatch(/<!doctype/);
-});
+ expect(data).toMatch(/<!doctype/);
+ },
+ {timeout: 10000},
+);
test('Should fail to download invalid files', async () => {
const downloadDir = tmpdir();