From e695bf8612e75db52ad1877cb73281efb66a012d Mon Sep 17 00:00:00 2001 From: Seth Silesky Date: Thu, 29 Sep 2022 22:56:30 -0500 Subject: [PATCH] delete unused helper --- packages/node/README.md | 6 +----- .../src/__tests__/graceful-shutdown-integration.test.ts | 5 ----- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/packages/node/README.md b/packages/node/README.md index 5e8c7e720..8fe05a325 100644 --- a/packages/node/README.md +++ b/packages/node/README.md @@ -38,7 +38,7 @@ const server = app.listen(3000) app.get('/', (req, res) => res.send('Hello World!')); const onExit = async () => { - await analytics.closeAndFlush() // flush all existing events + await analytics.closeAndFlush() // flush all existing events console.log("Closing server ..."); server.close(() => process.exit()); setTimeout(() => { @@ -49,10 +49,6 @@ const onExit = async () => { process.on("SIGINT", onExit); process.on("SIGTERM", onExit); - -process.on('SIGINT', onExit) -process.on('SIGTERM', onExit); -``` ``` ## Event Emitter diff --git a/packages/node/src/__tests__/graceful-shutdown-integration.test.ts b/packages/node/src/__tests__/graceful-shutdown-integration.test.ts index a4d9d666d..5334666f9 100644 --- a/packages/node/src/__tests__/graceful-shutdown-integration.test.ts +++ b/packages/node/src/__tests__/graceful-shutdown-integration.test.ts @@ -27,11 +27,6 @@ describe('Ability for users to exit without losing events', () => { makeTrackCall: (analytics = ajs, cb?: (...args: any[]) => void) => { analytics.track({ userId: 'foo', event: 'Thing Updated', callback: cb }) }, - listenOnDrain: (): Promise => { - return new Promise((resolve) => { - ajs.once('drained', () => resolve(undefined)) - }) - }, } describe('drained emitted event', () => {