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