Updated the test system

This commit is contained in:
Angelos Chalaris
2018-10-10 23:36:17 +03:00
parent 6479590abf
commit 0bc5d38f85
725 changed files with 385 additions and 2332 deletions

19
test/isStream.test.js Normal file
View File

@ -0,0 +1,19 @@
const expect = require('expect');
const { isStream } = require('./_30s.js');
const Stream = require('stream');
test('isStream is a Function', () => {
expect(isStream).toBeInstanceOf(Function);
});
test('isStream returns true for read streams', () => {
expect(isStream(new Stream.Readable())).toBeTruthy();
});
test('isStream returns true for write streams', () => {
expect(isStream(new Stream.Writable())).toBeTruthy();
});
test('isStream returns true for duplex streams', () => {
expect(isStream(new Stream.Duplex())).toBeTruthy();
});
test('isStream returns false for non-streams', () => {
expect(isStream({})).toBeFalsy();
});