From ec6146b2d46b136b7e2bca58c43b5ff87e9f3e4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Belin?= Date: Mon, 10 Jul 2017 19:51:14 +0200 Subject: [PATCH] Added new test cases --- test/client_test.js | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/test/client_test.js b/test/client_test.js index ae3bf17a..44cd4192 100644 --- a/test/client_test.js +++ b/test/client_test.js @@ -2,6 +2,8 @@ import {expect} from 'chai'; import {describe, it} from 'mocha'; +import {Observable} from 'rxjs/Observable'; +import {Subject} from 'rxjs/Subject'; import {URL} from 'url'; import {Author, Client, Comment, CommentType} from '../src/index'; @@ -40,6 +42,28 @@ describe('Client', function() { }); }); + /** + * @test {Client#onRequest} + */ + describe('#onRequest', () => { + it('should return an `Observable` instead of the underlying `Subject`', () => { + let stream = new Client().onRequest; + expect(stream).to.be.instanceof(Observable); + expect(stream).to.not.be.instanceof(Subject); + }); + }); + + /** + * @test {Client#onResponse} + */ + describe('#onResponse', () => { + it('should return an `Observable` instead of the underlying `Subject`', () => { + let stream = new Client().onResponse; + expect(stream).to.be.instanceof(Observable); + expect(stream).to.not.be.instanceof(Subject); + }); + }); + /** * @test {Client#submitHam} */