From ba518b750b725e97c2132f9da557ea3269d9d0c5 Mon Sep 17 00:00:00 2001 From: Bluebberies Date: Thu, 24 Oct 2024 01:53:40 +0100 Subject: [PATCH] Updated test file to check for non-writable stream --- test.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test.js b/test.js index d768f1d..c126d42 100644 --- a/test.js +++ b/test.js @@ -679,6 +679,16 @@ test('new clear method test, erases wrapped lines', t => { t.deepEqual(frames, currentFrames); }); +test('should throw TypeError when a non-writable stream is passed', t => { + const nonWritableStream = {}; + + const error = t.throws(_ => ora({stream: nonWritableStream}), { + instanceOf: TypeError, + }); + + t.is(error.message, 'Stream must be a writable stream'); +}); + test('new clear method, stress test', t => { const rando = (min, max) => { min = Math.ceil(min);