Updated the test system
This commit is contained in:
19
test/isReadableStream.test.js
Normal file
19
test/isReadableStream.test.js
Normal file
@ -0,0 +1,19 @@
|
||||
const expect = require('expect');
|
||||
const { isReadableStream } = require('./_30s.js');
|
||||
const Stream = require('stream');
|
||||
|
||||
test('isReadableStream is a Function', () => {
|
||||
expect(isReadableStream).toBeInstanceOf(Function);
|
||||
});
|
||||
test('isReadableStream returns true for read streams', () => {
|
||||
expect(isReadableStream(new Stream.Readable())).toBeTruthy();
|
||||
});
|
||||
test('isReadableStream returns false for write streams', () => {
|
||||
expect(isReadableStream(new Stream.Writable())).toBeFalsy();
|
||||
});
|
||||
test('isReadableStream returns true for duplex streams', () => {
|
||||
expect(isReadableStream(new Stream.Duplex())).toBeTruthy();
|
||||
});
|
||||
test('isReadableStream returns false for non-streams', () => {
|
||||
expect(isReadableStream({})).toBeFalsy();
|
||||
});
|
||||
Reference in New Issue
Block a user