Skip to content

Free, Open Source, Self-Hosted WhatsApp API Gateway

test(status): complete the global archiver mock with the TarArchive named export

Yudhi Armyndharis2492dd4e8c63
diff --git a/test/__mocks__/archiver.ts b/test/__mocks__/archiver.ts
index 8955f2c97..9476c2a4f 100644
--- a/test/__mocks__/archiver.ts
+++ b/test/__mocks__/archiver.ts
@@ -3,6 +3,21 @@
* imports it — directly (StorageService) or transitively (anything that injects StorageService or a
* module built on it, e.g. StatusStoreService) — fails to parse without this stub once pulled into the
* unit test graph. None of the unit suites exercise the tar/zip export path itself (that's covered by
- * the e2e config's real `archiver` via transformIgnorePatterns), so a bare default export is enough.
+ * the e2e config's real `archiver` via transformIgnorePatterns), so stubs for TarArchive and default
+ * export are sufficient.
*/
+
+export const TarArchive = jest.fn(() => ({
+ on: jest.fn(function () {
+ return this;
+ }),
+ pipe: jest.fn(function () {
+ return this;
+ }),
+ append: jest.fn(function () {
+ return this;
+ }),
+ finalize: jest.fn(() => Promise.resolve()),
+}));
+
export default jest.fn();