Fixing tests

This commit is contained in:
Mathew Kurian 2016-01-22 15:16:06 -06:00
parent 3766f58d5f
commit cd4b8df554
2 changed files with 16 additions and 6 deletions

View file

@ -51,5 +51,6 @@ Refer to [`examples`](/examples)
Documentation coming in the future Documentation coming in the future
```js ```js
console.pipe(expose, 'bash',new Inspector(), new DefaultConsole()); // console.pipe(expose, name, ...throughs);
console.pipe('log', 'bash',new Inspector(), new DefaultConsole());
``` ```

View file

@ -1,7 +1,7 @@
import Scribe from '../' import Scribe from '../'
import express from 'express' import express from 'express'
import expect from 'expect.js' import expect from 'expect.js'
import fetch from 'node-fetch' import request from 'superagent'
import async from 'async' import async from 'async'
describe('Basic Scribe', ()=> { describe('Basic Scribe', ()=> {
@ -32,10 +32,19 @@ describe('Basic Scribe', ()=> {
console.log(`Listening on ${port}`); console.log(`Listening on ${port}`);
async.each(new Array(requestsCount), (i, callback)=> { async.each(new Array(requestsCount), (i, callback)=> {
fetch(`http://localhost:${port}/test`) count++;
.then(res => res.text())
.then(text => console.log(`Received response ${++count}/${requestsCount}`, text)) request
.get(`http://localhost:${port}/test`)
.end((err, req)=> {
if (err) {
return callback();
} else {
console
.log(`Received response ${count}/${requestsCount}`, req.body)
.then(()=>callback()); .then(()=>callback());
}
});
}, () => { }, () => {
expect(count).to.equal(requestsCount); expect(count).to.equal(requestsCount);
done(); done();