Skip to content

Commit 594865f

Browse files
authoredJul 17, 2020
Silence Jest warning when Ora is required in a test (#150)
1 parent 132315d commit 594865f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed
 

‎index.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,14 @@ class StdinDiscarder {
9292
}
9393
}
9494

95-
const stdinDiscarder = new StdinDiscarder();
95+
let stdinDiscarder;
9696

9797
class Ora {
9898
constructor(options) {
99+
if (!stdinDiscarder) {
100+
stdinDiscarder = new StdinDiscarder();
101+
}
102+
99103
if (typeof options === 'string') {
100104
options = {
101105
text: options

0 commit comments

Comments
 (0)