Skip to content

Node.js based forum software built for the modern web

test: add more info to flaky test

Barış Soner Uşaklı499df7dd71e7
diff --git a/test/posts/uploads.js b/test/posts/uploads.js
index eb3e33d71d..51068c7fda 100644
--- a/test/posts/uploads.js
+++ b/test/posts/uploads.js
@@ -220,9 +220,13 @@ describe('upload methods', () => {
});
it('should purge the images from disk if the post is purged', async () => {
+ const currentUploads = await posts.uploads.list(postData.pid);
+ assert.strictEqual(currentUploads.length, 2, 'Post should have 2 uploads before purge');
+
await posts.purge(postData.pid, uid);
- assert.strictEqual(await file.exists(path.resolve(nconf.get('upload_path'), 'files', 'abracadabra.png')), false);
- assert.strictEqual(await file.exists(path.resolve(nconf.get('upload_path'), 'files', 'test.bmp')), false);
+
+ assert.strictEqual(await file.exists(path.resolve(nconf.get('upload_path'), 'files', 'abracadabra.png')), false, `current uploads ${currentUploads}`);
+ assert.strictEqual(await file.exists(path.resolve(nconf.get('upload_path'), 'files', 'test.bmp')), false, `current uploads ${currentUploads}`);
});
it('should leave the images behind if `preserveOrphanedUploads` is enabled', async () => {