Skip to content

Free, Open Source, Self-Hosted WhatsApp API Gateway

test(media): remove the stub ffmpeg directory after the suite

Yudhi Armyndharisc728509ed755
diff --git a/src/modules/media/ffmpeg-run.spec.ts b/src/modules/media/ffmpeg-run.spec.ts
index be426213d..6af591880 100644
--- a/src/modules/media/ffmpeg-run.spec.ts
+++ b/src/modules/media/ffmpeg-run.spec.ts
@@ -1,5 +1,5 @@
import { spawn, type ChildProcess } from 'node:child_process';
-import { chmod, mkdtemp, readdir, readFile, writeFile } from 'node:fs/promises';
+import { chmod, mkdtemp, readdir, readFile, rm, writeFile } from 'node:fs/promises';
import { tmpdir } from 'node:os';
import { join } from 'node:path';
import { FfmpegConversionError, probeFfmpeg, runFfmpeg } from './ffmpeg';
@@ -58,6 +58,10 @@ esac
await chmod(stubPath, 0o755);
});
+ afterAll(async () => {
+ await rm(workDir, { recursive: true, force: true });
+ });
+
/** Encoder arguments that put the stub into a given mode. */
const mode = (name: string): string[] => [`MODE=${name}`];