diff --git a/test/unit/tw_util_async_limiter.js b/test/unit/tw_util_async_limiter.js index ca36c28626d..db909934b9e 100644 --- a/test/unit/tw_util_async_limiter.js +++ b/test/unit/tw_util_async_limiter.js @@ -25,12 +25,13 @@ test('Runs callback', async t => { test('Errors', async t => { t.plan(1); - const callback = () => Promise.reject(new Error('Error123!')); + const errorObject = new Error('Testing testing 123'); // want to get the same *exact* object back + const callback = () => Promise.reject(errorObject); const limiter = new AsyncLimiter(callback, 10); try { await limiter.do(); } catch (e) { - t.equal(e, 'Error123!'); + t.equal(e, errorObject); } t.end(); });