I'm experimenting with reactive JS by writing mocha tests. I wrote a test that makes a certain number of requests to an API before stopping. However, this being my first experience with RxJS, I don't know if I'm doing things in the best way. Are there any obvious mistakes I'm making here?   it('uses canary', function(done) {  var eventEmitter = new EventEmitter();  var iterations = 3;  var source = Rx.Observable.fromEvent(eventEmitter, 'data').take(iterations);  var subscription = source     .subscribe(        function(data) {           console.log(data);        },        function(err) {           if (err) {              throw err;           }        },        function() {           console.log('completed');           done();        }     );  for (var k = 0; k < iterations; k++) {     request(app)        .get('/api/canarycanary')        .set('Accept', 'application/json')        .expect('Content-Type', /json/)        .end(function(err, res) {           eventEmitter.emit('data', res.body);        });  }});
Run code after making a certain number of requests using RxJS
javascript;mocha;rxjs