From 45adc2722a2a684a80a18b7da0cbbc9e52f93f3e Mon Sep 17 00:00:00 2001 From: Corentin Carteau Date: Wed, 15 Jul 2020 16:53:31 +0200 Subject: [PATCH] fix-memory-leak-in-jest-tests --- index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 43deae7..c18218a 100644 --- a/index.js +++ b/index.js @@ -92,10 +92,14 @@ class StdinDiscarder { } } -const stdinDiscarder = new StdinDiscarder(); +let stdinDiscarder; class Ora { constructor(options) { + if (!stdinDiscarder) { + stdinDiscarder = new StdinDiscarder(); + } + if (typeof options === 'string') { options = { text: options