diff --git a/test/media/api.test.mjs b/test/media/api.test.mjs index 0d6f901..ef94aba 100644 --- a/test/media/api.test.mjs +++ b/test/media/api.test.mjs @@ -40,6 +40,10 @@ t.describe('Media (API)', () => { assert.match(err.message, /[Tt]oken/) assert.match(err.message, /[Mm]issing/) + await new Promise(function(res) { + setTimeout(res, 10) + }) + assert.strictEqual(server.log.error.callCount, 0) assert.strictEqual(server.log.warn.callCount, 2) assert.strictEqual(typeof(server.log.warn.firstCall[0]), 'string') @@ -63,6 +67,10 @@ t.describe('Media (API)', () => { assert.strictEqual(err.status, 422) assert.match(err.message, /[Tt]oken/) assert.match(err.message, /[Ii]nvalid/) + + await new Promise(function(res) { + setTimeout(res, 10) + }) assert.strictEqual(server.log.error.callCount, 1) assert.strictEqual(server.log.warn.callCount, 2)