diff --git a/src/base.js b/src/base.js index 5bfe09c..8820ba9 100644 --- a/src/base.js +++ b/src/base.js @@ -33,7 +33,7 @@ class TimeKeeper { const d = process.hrtime(this.start); this.monitor.measure(this.name, d[0] * 1000 + d[1] / 1000000); } -}; +} class BaseMonitor { constructor() { diff --git a/src/index.js b/src/index.js index 59a28d2..0f27a4c 100644 --- a/src/index.js +++ b/src/index.js @@ -185,7 +185,7 @@ async function monitor(options) { } return m; -}; +} // ensure that only one SIGTERM handler is registered at any time let _sigtermHandler = null; diff --git a/test/mockmonitor_test.js b/test/mockmonitor_test.js index 5bd7938..649f6ab 100644 --- a/test/mockmonitor_test.js +++ b/test/mockmonitor_test.js @@ -75,7 +75,7 @@ suite('MockMonitor', () => { test('monitor.timer(k, value)', async () => { const v = monitor.timer('k', 45); - assert(v == 45); + assert(v === 45); // Sleep so that the promise handler can be handled before we check that // something was recorded... await new Promise(accept => setTimeout(accept, 10)); @@ -84,7 +84,7 @@ suite('MockMonitor', () => { test('monitor.timer(k, () => value)', async () => { const v = monitor.timer('k', () => 45); - assert(v == 45); + assert(v === 45); await new Promise(accept => setTimeout(accept, 10)); assert(monitor.measures['mm.k'].length === 1); }); @@ -94,7 +94,7 @@ suite('MockMonitor', () => { await new Promise(accept => setTimeout(accept, 100)); return 45; }); - assert(v == 45); + assert(v === 45); await new Promise(accept => setTimeout(accept, 10)); assert(monitor.measures['mm.k'].length === 1); }); diff --git a/test/uncaught_test.js b/test/uncaught_test.js index 3489a4a..188d84e 100644 --- a/test/uncaught_test.js +++ b/test/uncaught_test.js @@ -115,7 +115,7 @@ suite('Uncaught Errors', () => { 'Error: This should bubble up to the top', ].join('\n') )); - assert(_.endsWith(output, 'Failed to report error to Sentry after timeout!\n')); + assert(output.indexOf('failed to send exception to sentry: socket hang up') !== -1); done(); } catch (e) { done(e);