Skip to content

Commit

Permalink
Updated test file to check for non-writable stream
Browse files Browse the repository at this point in the history
  • Loading branch information
Bluebberies committed Oct 24, 2024
1 parent c480a70 commit ba518b7
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit ba518b7

Please sign in to comment.